Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Exercise 5.9 ( Find the two highest scores ) Write a program that prompts the user to enter the number of students and each

Programming Exercise 5.9 (Find the two highest scores) Write a program that prompts the user to enter the number of students and each students name and score, and finally displays the student with the highest score and the student with the second-highest score. Use the next() method in the Scanner class to read a name rather than using the nextLine() method. 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

Class Name: Exercise05_09

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions