Question: 1. Write a program that prompts the user for an input that is an int. The input represents a score that the student received on

 1. Write a program that prompts the user for an input

1. Write a program that prompts the user for an input that is an int. The input represents a score that the student received on a test. Your program should give an error if the input is not in a proper range (between 0 and 100 inclusive). For the valid input the program should calculate the letter grade (as a char) that the student will receive using the following mapping score 0-59->F score 60-69-> D score 70-79->C 9 score 80 89 -> B o score 90-100 -> A NOTE: Since the score is an int variable with values between O and 100, please note the following: if the score is 85, score/10 is 8, if the score is 89, score/10 is also 8; if the score is 62, score/10 is 6, if the score is 68, score/10 is also 6 and so on. You can use this expression as a switch variable and implement the program with a switch statement using the following mapping: - case 0, case 1, case 2, case 3, case 4 and case 5 are all the same and they map to F - case 6 maps toD - case 7 maps to C - case 8 maps to B case 9 and case 10 map to A - default case should assign an F The result must be calculated inside the switch but printed outside the switch statement. This example may help: RollDie.java Use the following flow of the program: f input is out of range give an error else using switch statement compute the value of the letter grade as char outside of the switch block print the result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!