Question: Write a program with reads a Celsius degree value from the console or a Fahrenheit degree value from the console , then converts it to

Write a program with reads a Celsius degree value from the console or a Fahrenheit degree value from the console , then converts it to Fahrenheit or Celsius and displays the result. The formulas for the conversion are as follows:

Fahrenheit = (9 / 5) * Celsius + 32

Celsius = (5/9) *(Fahrenheit -32)

I can write this program with ease using a If/Else statement, but we have to use a Switch/Case statement as well as a If/Else statement.

I know that I'll need a double for the conversion because it will have 9.0 or 5.0 to get the correct answer, but as you know, you cant use a double with a switch/case.

I've seen this part being used at the beginning but i'll need help understanding what it is because we have only learned public static void so far.

//public static double FahrenheitToCelsius(double fahrenheit)

I'd rather not use this way because i have not learned it yet.

Also please keep it simple, i'm only in chapter 3 of this intro to java programming 1.

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!