Question: In method main , write the Java code that prompts the user to enter the number of students. Then, using a loop, the user is
In method main, write the Java code that prompts the user to enter the number of students. Then, using a loop, the user is prompted to input that number of student names and associated scores. When the loop halts, the name and score of the student with the highest score is output. Assume that no two students will have the same score.
Sample run:
Enter the number of students: 6 Enter a student name: Bobby Enter the score for Bobby: 79 Enter a student name: Sue Enter the score for Sue: 65 Enter a student name: Alphonse Enter the score for Alphonse: 88 Enter a student name: Richard Enter the score for Richard: 73 Enter a student name: Sally Enter the score for Sally: 92 Enter a student name: Nancy Enter the score for Nancy: 84
Top Student: Sally with a score of 92
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
