InterviewSolution
Saved Bookmarks
| 1. |
Write a switch case statement, write a menu driven program to convert a given temperature from Fahrenheit to Celsius and vice versa. For an incorrect choice, an appropriate message should bedisplayed.c* (f-32) andf-1.8*c+32 |
|
Answer» tion:1) Read the temperature value using scanner OBJECT as SC. nextInt() and STORE it in the variable a. In this program, we have the static method celsius(double f), which converts the FAHRENHEIT temperature into Celsius temperature by using the formula (f-32)*5/9. |
|