Question: Create a class called TempConverter Write the main() method within the class Declare a constant called BASE with the value 32. The data type must

Create a class called TempConverter

Write the main() method within the class

Declare a constant called BASE with the value 32. The data type must be int.

Declare a constant called CONVERSION_FACTOR having the value 9.0 / 5.0. The data type must be double.

Declare two variables fahrenheitTemp and celsiusTemp. The data type must be double.

Accept the Celsius temperature from the user and assign it to celsiusTemp (Remember: To accept input you have to import the java.util package and create the Scanner class object)

Calculate the Fahrenheit equivalent using the formula given above and store the result in fahrenheitTemp

Display the Celsius temperature and its Fahrenheit equivalent

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!