Question: debugging code sample output import java.util.Scanner; 19 public class Temperature 20 21 22 public static void main(String args[]) [ 23 24 25 int option: int

debugging code  debugging code sample output import java.util.Scanner; 19 public class Temperature 20
21 22 public static void main(String args[]) [ 23 24 25 int
sample output
option: int degreel; int celsiusl; int fahrenheitl; 26 27 28 Scanner input

import java.util.Scanner; 19 public class Temperature 20 21 22 public static void main(String args[]) [ 23 24 25 int option: int degreel; int celsiusl; int fahrenheitl; 26 27 28 Scanner input = new Scanner ( System.in); option = 0; While ( option != 3) 29 30 31 32 33 34 35 36 37 38 39 40 41 System.out.printf("%s ts ts ", "1 for Fahrenheit to Celsius", "2 for Celsius to Fahrenheit", "3 to quit:" ); option input.nextDouble(); System.out.println("Enter the degrees in Fahrenheit: degreel = input.nextDouble(); 42 celsiusl = ( degreel 32) * 5/9; celsiusl = ( degreel 32) * / 9; System.out.printf("The temp in Celsius is td ", celsiusl ); 42 43 44 45 46 47 48 if ( option - 2): System.out.println("Enter the degrees in Celsius:" ); degreei - input.nextDouble(); 49 50 51 52 53 54 55 56 57 fahrenheitl - ( degreel * 9/5) + 32; System.out.printf("The temp in Fahrenheit is td ", fahrenheitl ): } // end while loop 1 // end method Main } // end class Temperature Sample output A 1 for Fahrenheit to Celsius 2 for Celsius to Fahrenheit 3 to quit: 1 Enter the degrees in Fahrenheit: 75 The temp in Celsius is 23.9 1 for Fahrenheit to Celsius 2 for Celsius to Fahrenheit 3 to quit: 2 Enter the degrees in Celsius: 23 The temp in Fahrenheit is 73.4 1 for Fahrenheit to Celsius 2 for Celsius to Fahrenheit 3 to quit: Process completed

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!