Search:

Type: Posts; User: Rhyssa6

Search: Search took 0.21 seconds.

  1. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    Thanks Norm, I understand what you mean about the variables being outside the scope of the method. I also had my file opening method wrong. I now have it all working excpet for one thing. When I call...
  2. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    I can't copy & post from the Task or Build view windows but the error messages are exactly what I posted above.
    In the StudentInfo file:
    cannot find symbol variable inputStream ...
  3. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    Dlorde, I do usually try to name my methods and objects more reasonably, that was about my 3rd copy of this assignment and I got lazy.
    Norm, I've tried to do what you suggested but I cannot get it...
  4. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    Here is my studentRecords code:


    prac Record = new Prac();

    public int studentRecords()
    {
    Scanner inputStream = null;

    try
  5. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    I now have this code working correctly (mostly) - the array reads each line in the text file and prints it out in the required format.
    However I've also tried writing other code for it which has a...
  6. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    This is the code I tried for making a new array:

    double marks2[] = new double[5];

    for (i=0; i< marks.length; i++)
    {
    marks[i] = marks2[i];
    System.out.println(marks[i]);
    }
  7. Replies
    15
    Views
    2,689

    Re: While loop not iterating correctly

    I figured out what the problem is, but not how to fix it. Marks[] is an array of 5 doubles for each student. The array is being filled by the values on the first iteration of the loop so it doesn't...
  8. Replies
    15
    Views
    2,689

    While loop not iterating correctly

    ***While loop now working, just need an argument for a method.***

    I have a text file with 8 lines of information. Each line has an int (UniqueID), a string (name) and 5 doubles (marks). Each item...
Results 1 to 8 of 8