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:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question
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:
Transcribed Image Text: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:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,