Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 "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
Step: 1
Here is a Java program to calculate the grade of a student using switch and validate the input impor...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started