Question: Question 2: Grade Calculator (Use switch and f Write a program that takes a student's score (out of 100) as input and prints out

Question 2: Grade Calculator (Use

Question 2: Grade Calculator (Use "switch" and "f Write a program that takes a student's score (out of 100) as input and prints out their corresponding grade according to the following scale (use "switch" for this calculation): 90-100: A 80-89: B 70-79: C 60-69: D Below 60: F Please validate the input (use "if" and "if... else" for validation). The input can be between 0 to 100 inclusive. Integer or real number is allowed, le. the user can enter 89 or 89.5, . If the input is below 0, display "The score has to be zero or above. Please try again.". And wait for another input. If the input is above 100, display "The score has to be below 100. Please try again.". And wait for another input. . If the second time input is still invalid, display "It is still an invalid input. Bye!". And the program stops (use System.exit(1), please consult the online JDK API for its meaning). 4 The output is shown as following Figure 6: a normal input between 0 to 100 ****** Welcome to Grade Calculator **** **** Enter the student's score (out of 100): 90 The student's grade is: A Figure 7: first input below 0. second input is between 0 to 100 Welcome to Grade Calculator. **** **** Enter the student's score (out of 100): -10 The score has to be zero or above. Please try again. 80 The student's grade is: B

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is a Java program to calculate the grade of a student using switch and validate the input impor... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!