Richard P.

asked • 04/02/24

(Find the two highest scores)

Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score and the student with the second-highest score. Assume that the number of students is at least 2.


Sample Run

Enter the number of students: 5

Enter a student name: Smith

Enter a student score: 60

Enter a student name: Jones

Enter a student score: 96

Enter a student name: Peterson

Enter a student score: 85

Enter a student name: Greenlaw

Enter a student score: 98

Enter a student name: Zhang

Enter a student score: 95

Top two students:

Greenlaw's score is 98.0

Jones's score is 96.0

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.