Question: public class TemperatureConverter { public static void main ( String [ ] args ) { / / Declare the constants. final double MIN _ FAHRENHEIT
public class TemperatureConverter
public static void mainString args
Declare the constants.
final double MINFAHRENHEIT ;
Declare the variables.
double fahrenheit;
double convertedDegrees ;
int tempScale;
String tempScaleStr;
Creating the Scanner object
Scanner keyboard new ScannerSystemin;
System.out.printEnter the temperature in Fahrenheit: ;
fahrenheit keyboard.nextDouble; Set a breakpoint here
Verify the user's input
if fahrenheit MINFAHRENHEIT first ifstatement: Set a breakpoint here
System.out.printThe temperature must be greater than or equal to MINFAHRENHEIT;
System.exit;
System.out.print
"Enter the temperature scales you want to convert to:
Kelvin
Rankine
Reaumur
Celsius
"Enter a temperature scale: ;
tempScale keyboard.nextInt;
if tempScale tempScale Secondif statement: Set a breakpoint here
System.out.printlnUnknown temperature scale
cannot do calculation. Bye";
else
if tempScale Set a breakpoint here
convertedDegrees fahrenheit ;
tempScaleStr"Kelvin";
else if tempScale tempScale
convertedDegrees fahrenheit ;
tempScaleStr"Rankine";
else if tempScale
convertedDegrees fahrenheit ; Set a breakpoint here
tempScaleStr"Reaumur";
else
convertedDegrees fahrenheit ; Set a breakpoint here
tempScaleStr"Celsius";
System.out.printlnfahrenheit degrees Fahrenheit is convertedDegrees degrees tempScaleStr ;
keyboard.close;
How do I fix my code since I already try to debugg it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
