grade is a char variable that holds a letter grade 'A', 'B', 'C', 'D', or 'F'. Write a switch statement that prints one of the messages in the table below based on the value in grade.



What will be an ideal response?

```
switch (grade){
case'A':
System.out.println("Excellent!");
break;
case 'B':
System.out.println("Very Good");
break;
case 'C':
System.out.println("Good");
break;
case 'D':
System.out.println("You can do better");
break;
case 'F':
System.out.println("You must do better");
break;
default:
System.out.println("Error – invalid grade detected");

} // end switch
```

Computer Science & Information Technology

You might also like to view...

Which of the following statements are correct?

a. When you create an array using new int[10], an array object is created with ten integers of value 0. b. When you create an array using new int[10], an array object is created with no values in the array. c. When you create an ArrayList using new ArrayList(), an ArrayList object is created with no elements in the ArrayList object. d. When you create an array using int[] x = new int[10], x.length() is 10. e. When you create an array using ArrayList x = new ArrayList(10), x.size() is 10.

Computer Science & Information Technology

The system administrator has deployed updated security controls for the network to limit risk of attack. The security manager is concerned that controls continue to function as intended to maintain appropriate security posture. Which of the following risk mitigation strategies is MOST important to the security manager?

A. User permissions B. Policy enforcement C. Routine audits D. Change management

Computer Science & Information Technology