Java: Accepts students name, id, and marks and display the highest score and the lowest score
Highest and Lowest Scores from Student Data
Write a Java program that accepts students' names, ids, and marks and displays their highest and lowest scores.
The student name and id are all strings of no more than 10 characters. The score is an integer between 0 and 100.
Visual Presentation:
Sample Solution:
Java Code:
Sample Output:
Input number of students: 3 Input Student Name, ID, Score: Devid v1 72 Peter v2 68 Johnson v3 85 name, ID of the highest score and the lowest score: Johnson v3 Peter v2
Flowchart:
For more Practice: Solve these Related Problems:
- Write a Java program to determine the highest and lowest scores from student data and then compute the average score.
- Write a Java program to identify the top two highest and bottom two lowest scoring students from the input data.
- Write a Java program to sort student records by scores and output the names corresponding to the highest and lowest scores.
- Write a Java program to find the student with the highest score and the one with the lowest score and then compute the score difference.
Go to:
PREV : Validate String for XYZ Rules.
NEXT : Convert 3-Digit Numbers to "HHTTT123" Format.
Java Code Editor:
Contribute your code and comments through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.