Question
//Using Java TemperatureConverter A formula for converting temperature in Kelvin to degrees Fahrenheit is as follows: Fahrenheit = Kelvin * (9/5) - 459.67 Your goal
//Using Java
TemperatureConverter
A formula for converting temperature in Kelvin to degrees Fahrenheit is as follows:
Fahrenheit = Kelvin * (9/5) - 459.67
Your goal for this assignment is to write one file, TemperatureConverter.java, which prompts the user for a temperature in Kelvin, converts the temperature to degrees Fahrenheit, and then outputs the results by printing it to the terminal. Note that the temperature provided by the user may or may not have a decimal value (e.g. 42 and 3.14159 are both valid inputs). The converted result that you output should be rounded to two decimal places (e.g. 2 -> 2.00, 28.1231 -> 28.12). You may assume that the user will enter a valid number when prompted for a temperature.
Below is an example of the way a user would interact with your program. Be sure to follow the syntax exactly. Note that each execution ends with a newline character (after Fahrenheit), and that the temperature in Kelvin is identical to the input when it is printed back to the console.
$ java TemperatureConverter Enter a temperature in Kelvin: 291.2359 291.2359 Kelvin is 64.55 degrees Fahrenheit $ java TemperatureConverter Enter a temperature in Kelvin: 278.706 278.706 Kelvin is 42.00 degrees Fahrenheit
To prevent trivialization of the assignment, you are only allowed to import the following classes:
java.util.Scanner java.lang.Math
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started