Question: Q2: Using your own coding example, or modifying the coding examples in the lecture, write a working Java program using switch construct that: First declares

Q2: Using your own coding example, or modifying the coding examples in the lecture, write a working Java program using switch construct that: First declares a variable of an appropriate data type and initializes it with the temperature of the day. Write a switch body to check if temperature of the day is equal to 90, 80, 70, or 60, and display appropriate message relevant to the temperature of the day as follows: i) if temperature of the day is 90 display on the console message BURNING HOT ii) if temperature of the day is 80 display on the console message HOT ii) if temperature of the day is 70 display on the console message PLEASANT iv) if temperature of the day is 60 display on the console message COLD If no condition is TRUE, set the default to display on console message TEMPERATURE COULD NOT BE DISPLAYED.

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!