Question:
You've been hired by Temperature Tempests to write a Java console application that converts between Celsius, Kelvin, and Newton temperature units. Prompt the user for a conversion code:
Code
|
Conversion
|
Last run input
|
a
|
Celsius ® Kelvin
|
32
|
b
|
Celsius ® Newton
|
64
|
c
|
Kelvin ® Celsius
|
200
|
d
|
Kelvin ® Newton
|
300
|
e
|
Newton ® Celsius
|
24
|
f
|
Newton ® Kelvin
|
28
|
Then prompt the user for a temperature value, calculate the conversion, and show the two values.
Use printf to format the output in two columns with the first column containing a label and the second column containing a value. Format the values to three decimal places.
You may use (char) 176 to include the degree symbol after a value. Use the inputs shown in the table for the last six runs.