Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 1 of 2 12 LastLast
Results 1 to 25 of 38

Thread: Two-Dimensional Array to Grade Students?

  1. #1
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Two-Dimensional Array to Grade Students?

    I'm a bit stuck with a homework assignment.

    Here is my working code...
       import java.util.Scanner;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};
     
             for (int i = 0; i < answers.length; i++) {
     
                int correctCount = 0;
                for (int j = 0; j < answers[i].length; j++) {
                   if (answers[i][j] == keys[j])
                      correctCount++;     
                } 
                System.out.println("Student " + i + "'s correct count is " + correctCount);
             }
          }
       }

    Well my teacher wants some "tweaks" made to the program that I'm having trouble figuring out.

    He wants me to display the students in increasing order of the numbers of correct answers. He also wants the grade inputs echoed before the return.

    Can someone give me a hand with this?


  2. #2
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Smile Re: Two-Dimensional Array to Grade Students?

    What do you mean by "grade inputs echoed before the return"?

    main is void. It doesn't have a return(unless you'd like to call one like
    return;
    , which will basically be the same thing as System.exit(0); in this case).

    I'm assuming you mean the println().

    I did so far find a way to figure out how to keep your correct count for each student even after your for loops end.

    I'm not that good at sorting things but might be able to think of more when it's not 2:00 a.m..

    I have this so far:

    	import java.util.*;
     
    	public class Student
    	{
     
    	private int correctCount;
     
    	public Student (int correctCount)
    	{
    	 setCorrectCount(correctCount);
    	}
     
    	public void setCorrectCount(int correctCount)
    	{
    	this.correctCount = correctCount;
    	}
     
    	public int getCorrectCount()
    	{
    	return correctCount;
    	}
    	}

     import java.util.Scanner;
       public class GradeExam {
     
     
     
    	static Student[] students;
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};
              students = new Student[answers.length];
     
    			for (int k =0; k < students.length; k++)
    			{
    			students[k] = new Student(0);
    			}
     
     
     
             for (int i = 0; i < answers.length; i++) {
     
                int correctCount = 0;
     
                for (int j = 0; j < answers[i].length; j++) {
                   if (answers[i][j] == keys[j])
                      correctCount++;     
    						students[i].setCorrectCount(correctCount);
                } 
                System.out.println("Student " + i + "'s correct count is " + correctCount);
             }
     
    			for (int v =0; v < students.length; v++)
    			{
    			System.out.println(students[v].getCorrectCount());
    			}
          }
       }

    Quote Originally Posted by Console
    Student 0's correct count is 7
    Student 1's correct count is 6
    Student 2's correct count is 5
    Student 3's correct count is 4
    Student 4's correct count is 8
    Student 5's correct count is 7
    Student 6's correct count is 7
    Student 7's correct count is 7
    7
    6
    5
    4
    8
    7
    7
    7

  3. #3
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Not sure what your code did to keep up with the count. The program already kept up with that.

    I did however solve the "echoing" the input of the students grades before the results...

       import java.util.Scanner;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};
     
     
             for (int i = 0; i < answers.length; i++) {
     
                int correctCount = 0;
                for (int j = 0; j < answers[i].length; j++) {
                   System.out.println(answers[i][j]);
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }          
                System.out.println("Student " + i + "'s correct count is " + correctCount);
             }
          }
       }

    My problem now is just the sorting problem. For some reason I feel I need to use a selection sort or something on the correctCount?

    Not sure how to pull that off yet. Any ideas?

  4. #4
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by Java Neil View Post
    Not sure what your code did to keep up with the count. The program already kept up with that.

    I did however solve the "echoing" the input of the students grades before the results...

       import java.util.Scanner;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};
     
     
             for (int i = 0; i < answers.length; i++) {
     
                int correctCount = 0;
                for (int j = 0; j < answers[i].length; j++) {
                   System.out.println(answers[i][j]);
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }          
                System.out.println("Student " + i + "'s correct count is " + correctCount);
             }
          }
       }

    My problem now is just the sorting problem. For some reason I feel I need to use a selection sort or something on the correctCount?

    Not sure how to pull that off yet. Any ideas?
    I've been working on this one a while as you can see, and I'm still stuck. Once again, I need to figure out how to "sort" the students and their grades before the display. Can someone give me a hand with this?

    Neil

  5. #5
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Well I have made some progress. My teacher requires everything that can be done in JOptionPane to be so.

    Here is the updated code...

       import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
     
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert input to a String
                String result = "Student " + i + "'s answers were \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }        
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\nStudent " 
                   + i + "'s correct count is " + correctCount);                 
             }
          }
       }

    I still need some help on sorting everything based on the correct count of the grades. I've really tried everything I can think of and am at the point of pulling my hair out. Pleeeeeeese help! Even if it's just a tip on how to think of the logic.

  6. #6
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    For sorting, I would create a third array, of ints. This array would be the size of the number of students (with index 0 being the first student, index 1 being the second, and so on). After each inner loop has finished, I would enter the value of the correctCount variable into the array, and then move onto the next student. After you have completed each student, you could then sort the array you just created with a selection sort, or bubble sort, etc. Whichever your poison...and then you can output with JOptionPane.

    This is the way I would go about solving this problem, it is simpler to break things down as simple as possible and go from there. That being said, there are many other ways solve this...
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  7. #7
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    For sorting, I would create a third array, of ints. This array would be the size of the number of students (with index 0 being the first student, index 1 being the second, and so on). After each inner loop has finished, I would enter the value of the correctCount variable into the array, and then move onto the next student. After you have completed each student, you could then sort the array you just created with a selection sort, or bubble sort, etc. Whichever your poison...and then you can output with JOptionPane.

    This is the way I would go about solving this problem, it is simpler to break things down as simple as possible and go from there. That being said, there are many other ways solve this...
    Once again you show your experience. Great way of looking at my problem.

    Here is my code with a sorting loop in it.

    import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }        
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 + "\nStudent " 
                   + i + "'s correct count is " + correctCount);                 
             }
             int[] list = new int[8];
     
             for (int i = 0; i < list.length - 1; i++) {
              //Find the minimum in the list 
                int currentMin = list[i];
                int currentMinIndex = i;
     
                for (int j = i + 1; j < list.length; j++) {
                   if (currentMin > list[j]) {
                      currentMin = list[j];
                      currentMinIndex = j;
                   }
                }
              //Swap list[i] with list[currentMinIndex] if necessary
                if (currentMinIndex != i) {
                   list[currentMinIndex] = list[i];
                   list[i] = currentMin;
                }
             }
          }
       }

    Where I'm failing to understand is where in the loop to place the correctCount.

    Thank you so much for your tutelage.
    Last edited by Java Neil; March 20th, 2011 at 10:10 AM.

  8. #8
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Here is your original code, with some notes:

     import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
            // Create new array here                <-------------------------------
     
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert input to a String
                String result = "Student " + i + "'s answers were \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }        
              //Display the input
     
              //  Enter value of correctCount into array
     
              // Remove the following two lines of code, this will be done later
                JOptionPane.showMessageDialog(null, result + "\nStudent " 
                   + i + "'s correct count is " + correctCount);                 
             }
     
           // Sort the array here
          // Then display the array with JOption pane
          }
       }
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  9. #9
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Well I see where you're going with this and it looks to be a lot less lines and concepts than I thought might be involved.

    I guess I'm confused about the adding correctCount to the array part. I'm not 100% certain of where correctCount would fall syntax wise.

    Here is the code with the new array for an int.

       import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
          // Create new array here                <-------------------------------
             int[] sort = new int[8];
     
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert input to a String
                String result = "Student " + i + "'s answers were \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                }        
              //Display the input
                JOptionPane.showMessageDialog(null, result);
              //  Enter value of correctCount into array
     
              // Remove the following two lines of code, this will be done later                 
             }
     
           // Sort the array here
          // Then display the array with JOption pane
          }
       }

    I'm stuck here because I'm not sure the syntax for putting correctCount into the array? I'm sure it uses a for loop, but what do you ++ to traverse the array? I'm guessing that would be int student? The complicated part in my head is keeping up with the student + their correctCount? Such is two dimensions.

    The problem for me is sorting the student because of their correctCount This means that the student and the correctCount need to be one object, or at least linked to one another, with the correctCount being the part that sorts them.

    Am I a sick man for loving the challenge?

    Either way, It's cool talking java with you. I'm actually learning more from you than my teacher! Sad but true.

    Thanks!
    Last edited by Java Neil; March 21st, 2011 at 12:08 AM.

  10. #10
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    OK I'm getting closer.

       import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n";
             for (int x = 0; x < 8; x++) {
                studentSort += student[x] + " \n";
             }
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;            		    
                } 	   
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 + 
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    This at least echoes everything my teacher wants and there is an array for sorting the students at the end. Now I just need to figure out how to enter the students "correctCount" into the array.

    Can you give me some more tutelage?
    Last edited by Java Neil; March 21st, 2011 at 06:38 AM.

  11. #11
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    I hate to be a needy person, but I really need some help here. This is due to turn in tomorrow!

  12. #12
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    To enter the correctCount into the array:

    sort[i] = correctCount

    With this code, if 'i' was 2 and correctCount was 7, then student number 3 (remember, start at 0) would have 7 correct answers. Look at the previous code I displayed in a previous post to see where you enter this into your code. This should be entered after each inner loop has completed, and before you move onto the next student.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  13. #13
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    To enter the correctCount into the array:

    sort[i] = correctCount

    With this code, if 'i' was 2 and correctCount was 7, then student number 3 (remember, start at 0) would have 7 correct answers. Look at the previous code I displayed in a previous post to see where you enter this into your code. This should be entered after each inner loop has completed, and before you move onto the next student.
    Wow...your grasp of java is amazing! My grasp...not so much.

    I tried to apply what you said to no avail. It's not storing the correctCount? I've obviously missed something.

    I used the new array student[i] = correctCount; When I used sort[i] = correctCount it just said the it couldn't find it.

    Here is my latest code...

       import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n";
             for (int x = 0; x < 8; x++) {
                studentSort += student[x] + " \n";
             }
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 + 
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }
     
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    Could you make some more notes with this code? I have the first display just as my teacher wants it, but if I have to change everything, so be it.

    You the man!

  14. #14
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    A quick word of advice, when writing code, there are many things that factor into the readability of your code. This includes but is not limited to: line indentation, the use of open space, the use of brackets, etc. See Java Coding Style Guide for more info

    I bring this up because although it may be tempting to not use brackets with an if statement, it may reduce someone's ability to read it correctly. Also, make sure all lines are justified correctly, with your code, it almost looks like the line:
    student[i] = correctCount;
    is included in the if statement. Left justify to correct this, especially of you are asking people to read your code.

    for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                }

    Moving forward, here are some notes

    import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n";
             for (int x = 0; x < 8; x++) {                       // This block of code is out of place
                studentSort += student[x] + " \n";            // Move this String declaration and for loop to below
             }
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 +        // Leave this code here to display
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }
            // Here you want to sort the array, I think I remember helping you with a bubble sort algorithm so this shouldn't be  too hard.
     
            // After the array is sorted, use the code from above if you'd like to enter the information into a string so that you 
           // Can output with JOptionPane
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    I'm not sure what your teacher wants as far as display, but as far as I can see you shouldn't have to re-write anything. Post back with more questions. At this point, helping you a step at a time is probably most beneficial so you don't feel overwhelmed.
    Last edited by vanDarg; March 21st, 2011 at 05:49 PM.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  15. #15
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    A quick word of advice, when writing code, there are many things that factor into the readability of your code. This includes but is not limited to: line indentation, the use of open space, the use of brackets, etc. See Java Coding Style Guide for more info

    I bring this up because although it may be tempting to not use brackets with an if statement, it may reduce someone's ability to read it correctly. Also, make sure all lines are justified correctly, with your code, it almost looks like the line:
    student[i] = correctCount;
    is included in the if statement. Left justify to correct this, especially of you are asking people to read your code.

    for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                }

    Moving forward, here are some notes

    import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n";
             for (int x = 0; x < 8; x++) {                       // This block of code is out of place
                studentSort += student[x] + " \n";            // Move this String declaration and for loop to below
             }
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 +        // Leave this code here to display
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }
            // Here you want to sort the array, I think I remember helping you with a bubble sort algorithm so this shouldn't be  too hard.
     
            // After the array is sorted, use the code from above if you'd like to enter the information into a string so that you 
           // Can output with JOptionPane
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    I'm not sure what your teacher wants as far as display, but as far as I can see you shouldn't have to re-write anything. Post back with more questions. At this point, helping you a step at a time is probably most beneficial so you don't feel overwhelmed.
    First I want to apologize for the bad coding style. I have saved that PDF for a nice long read. I'm sure it's a pain for you pros to read script that is not well formatted.

    Secondly as far as the code, I understand what needs to be done from your notes. My concern is as of now the code is not storing the input to be sorted i.e The student and their correctCount. Right now the last printout looks like...

    The list of students in order:
    0
    0
    0
    0
    0
    0
    0
    0

    Doesn't that mean I have nothing to sort?

  16. #16
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Oh don't worry about it, no big deal I just wanted to let you know.
    And yes, all zeros would mean that you don't have to sort it. But we are obviously getting that in error. Thoroughly check your code, ensure that you are accessing the correct array when listing the students.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  17. #17
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    Oh don't worry about it, no big deal I just wanted to let you know.
    And yes, all zeros would mean that you don't have to sort it. But we are obviously getting that in error. Thoroughly check your code, ensure that you are accessing the correct array when listing the students.
    I thought you said that "student[i] = correctCount;" was the proper way to enter the correctCount into the array?

    I promise I'm trying as hard as I can. I am no slacker. I'm just missing the point.

  18. #18
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    It is the correct way, which is why I suspect that this line may be out of place, or that you are not accessing the correct array. Post your final code again, please
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  19. #19
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    It is the correct way, which is why I suspect that this line may be out of place, or that you are not accessing the correct array. Post your final code again, please
    Sure thing

    import javax.swing.JOptionPane;
       public class GradeExam {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n" + "\n";
             for (int x = 0; x < 8; x++) {
                studentSort += student[x] + " \n";
             }
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 +        // Leave this code here to display
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }
            // Here you want to sort the array, I think I remember helping you with a bubble sort algorithm so this shouldn't be  too hard.
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    You have the patience of a good teacher!

  20. #20
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    import javax.swing.JOptionPane;
       public class Pract {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
             int[] student = new int[8];
           //Create new array to sort students 
             String studentSort = "The list of students in order: \n" + "\n";
             for (int x = 0; x < 8; x++) {
                studentSort += student[x] + " \n";   // this code is incorrect and is not necessary -> ERASE
             }                            // You are just entering 0's into the array, not the value of anything meaningful
                                          // Which is why are you displaying zeros
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + i + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
    						student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 +        // Leave this code here to display
                   "\nStudent " + i + "'s correct count is " + correctCount);                 
             }               // Here, add 1 to i -> (i + 1) because there is no student 0...
            // Here you want to sort the array, I think I remember helping you with a bubble sort algorithm so this shouldn't be  too hard.
             // YOU ARE NOT SORTING THE ARRAY, THIS IS WHERE TO SORT THE ARRAY
             // Sort the array "student", and then enter the results into a string
     
             JOptionPane.showMessageDialog(null, studentSort);
          }
       }

    Steps to take:
    1) Sort the array "student"
    2) Loop through the array, and save each value in a string
    3) Display the string
    Last edited by vanDarg; March 21st, 2011 at 07:49 PM.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  21. #21
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    OK...I've actually made some progress

       import javax.swing.JOptionPane;
       public class Pract {
          public static void main(String[] args) {
             char[][] answers = {
                   {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'},
                   {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
                   {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
                   {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
                   {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; 	
     
             char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'};       
           //Create new array to sort students
             int[] student = new int[8];
     
           //Echo the answers
             String result = "The answer key to the test: \n";
             for (int k = 0; k < 10; k++) {
                result += keys[k] + " ";
     
             }
             for (int i = 0; i < answers.length; i++) {
                int correctCount = 0;
              //Convert grades to a String
                String result2 = "Student " + (i + 1) + "'s answers are: \n";
                for (int j = 0; j < answers[i].length; j++) {
                   result2 += answers[i][j] + " ";
                   if (answers[i][j] == keys[j])
                      correctCount++;
                   student[i] = correctCount;           		    
                } 	
     
              //Display the input
                JOptionPane.showMessageDialog(null, result + "\n" + result2 +        
                   "\nStudent " + (i + 1) + "'s correct count is " + correctCount);                 
             }               
               //Find the maximum in the list
             for (int i = student.length - 1; i > 0; i--) {          
                int currentMax = student[i];
                int currentMaxIndex = i;          
     
                for (int j = i - 1; j > (-1); j--) {
                   if (currentMax < student[j]) {
                      currentMax = student[j];
                      currentMaxIndex = j;
                   }
                }
     
                 //Swap student[i] with list[currentMinIndex] if necessary
                if (currentMaxIndex != i) {
                   student[currentMaxIndex] = student[i];
                   student[i] = currentMax;
     
                 //Convert input to a String
                   String result3 = "Students scores \n";
                   for (i = 0; i < student.length; i++) {
                      result3 += student[i] + " \n";
                   }
     
                 //Display the input
                   JOptionPane.showMessageDialog(null, result3);  
                }
             }
          }
       }

    The program now saves the correctCount and sorts it. Thanks!

    My only problems are there is no student associated with the scores and the the sorting takes a few iterations to actually sort.

    What am I overlooking?

  22. #22
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Good work.
    First, you CAN associate a student with the score, since the array at position 0 would represent student 1, and position 1 would represent student 2, and so on:

    String result3 = "Students scores \n";
                   for (i = 0; i < student.length; i++) {
                      result3 += "Student number " + i + "score: " + student[i] + " \n";
    Just add 1 to i
    Second, you are entering the information into a string within an if statement, place it outside of that statement, as well as outside of the loop doing the sorting. Entering this information into a string should come after the sorting has completed.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  23. #23
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    OK...let me mess with this logic

  24. #24
    Member vanDarg's Avatar
    Join Date
    Jan 2011
    Location
    Chicago
    Posts
    65
    My Mood
    Mellow
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    You could use another multi-dimensional array here, but it seems unnecessary.
    "Everything should be made as simple as possible, but not simpler."
    Asking Questions for Dummies | The Java Tutorials | Java Coding Styling Guide

  25. #25
    Member Java Neil's Avatar
    Join Date
    Jan 2011
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Two-Dimensional Array to Grade Students?

    Quote Originally Posted by vanDarg View Post
    Good work.
    First, you CAN associate a student with the score, since the array at position 0 would represent student 1, and position 1 would represent student 2, and so on:

    String result3 = "Students scores \n";
                   for (i = 0; i < student.length; i++) {
                      result3 += "Student number " + i + "score: " + student[i] + " \n";
    Just add 1 to i
    Second, you are entering the information into a string within an if statement, place it outside of that statement, as well as outside of the loop doing the sorting. Entering this information into a string should come after the sorting has completed.
    Well I am not seeing the students switch with the correctCount. The students are not being sorted.

    Should I use

    int[][] student = new int[8][8];

    to store the two values?

    Also I'm not seeing what you mean with the if statements.

Page 1 of 2 12 LastLast

Similar Threads

  1. Single Dimensional Array Help!
    By Allicat in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 15th, 2011, 12:01 PM
  2. Two-Dimensional Array and Loops
    By astrojunk in forum Java Theory & Questions
    Replies: 2
    Last Post: February 11th, 2011, 06:18 AM
  3. 2 dimensional array alternative ???
    By zeeshanmirza in forum Java SE APIs
    Replies: 1
    Last Post: February 23rd, 2010, 05:18 PM
  4. Grade Array Trouble
    By kite98765 in forum Collections and Generics
    Replies: 3
    Last Post: January 7th, 2010, 07:14 PM
  5. Grade averaging program with array and multiple methods.
    By jeremykatz in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 9th, 2009, 08:44 PM