Menu

[solved] – Question 70240

Create a program that input a grade from the user. The grade input from the user will be an integer. Once the
input is stored, use an if-else-if block of code to determine the letter grade of the inputted integer grade. Do
not use if statements by itself or another strategy to solve this problem. You will print and “Error” for inputs
greater than 100. You will also print an “Error” for inputs less than 0. Both errors must be handled together
by a compound conditional statement that is joined by a short circuit &&. The error should not be a print
statement. It should use a String variable that is assigned the value of ERROR. You must a Char variable for
each letter grade. You must use a System.out.println for printing the error. You must a System.out.printf for
printing the letter grade.
You will run the program three times. Each time you run the program you will enter three different inputs.
1. 140
2. -42
3. 85

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *