Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- Here's the changes:
- System.out.println("Enter number of grades to submit: ");
- //inputScore = console.nextInt();
- int number = console.nextInt();
- // for (int i = -1; i < inputScore; i++)
- for (int i = 0; i < number; i++)
Add Comment
Please, Sign In to add comment