Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3.22 Grade Report with switch Instructor note Hint: You do NOT need 100 cases in your switch statement. You only care about the tens digit;
3.22 Grade Report with switch Instructor note Hint: You do NOT need 100 cases in your switch statement. You only care about the tens digit; the ones digit is irrelevent. ie. 90-99 all get A's. 80-89 all get B's. What can you do mathematically before the switch to eliminate the one's digit? Write a program that takes as input a grade between 0 and 100 and uses a switch statement to output a message corresponding to the letter grade received. Output should be: Enter a numeric grade (0 to 100): 86 Letter grade: B Nice job. Enter a numeric grade (0 to 100): 98 Letter grade: A Excellent. Enter a numeric grade (0 to 100): 75 Letter grade: C Average. Enter a numeric grade (0 to 100): 60 Letter grade: D Poor Enter a numeric grade (0 to 100): 45 Letter grade: F See the instructor. LAB ACTIVITY 3.22.1: Grade Report with switch 0/6 GradeReport.java Load default templat... 2 GradeReport.java 3 11 4 Demonstrates the use of a switch statement 6 7 import java.util.Scanner 9 public class GradeReport 10 Enter a numeric grade (0 to 100): 60 Letter grade: D Poor. Enter a numeric grade (0 to 100): 45 Letter grade: F See the instructor. LAB ACTIVITY 3.22.1: Grade Report with switch 0/6 GradeReport.java Load default template.. 1 s 2 I/ GradeReport.java 3 11 4 // Demonstrates the use of a switch statement 5 1 7 import java.util.Scanner 9 public class GradeReport 10 // Reads a grade from the user and prints comments accordingly 12 13 14 public static void main String[ args) 15 16 17 18 19 20 21 System.out.printlnC"Enter a numeric grade C0 to 100): "; 24 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Develop mode Submit mode
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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