Guest User

Untitled

a guest
Jun 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Did you notice that it doesn't ask for the appropriate number of inputs (i.e. if I enter 5 for the number of students, I would expect that it would ask me for 5 sets of names and scores). Have a separate variable for the number of students - don't use your inputScore variable for both the number of students and the score that is entered - it messes up your for loop.
  2.  
  3. Here's the changes:
  4.  
  5. System.out.println("Enter number of grades to submit: ");
  6.  
  7.  
  8.  
  9. //inputScore = console.nextInt();
  10.  
  11.  
  12.  
  13. int number = console.nextInt();
  14.  
  15.  
  16.  
  17. // for (int i = -1; i < inputScore; i++)
  18.  
  19.  
  20.  
  21. for (int i = 0; i < number; i++)
Add Comment
Please, Sign In to add comment