package GoJava_Core4;

import java.util.Scanner;

public class temperature_conv {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

// read user input
        System.out.println("Enter 1. Fahrenheit to Celsius:");
        System.out.println("Enter 2. Celsius To Fahrenheit:");
        int input = scanner.nextInt();


        if (input == 1){
            System.out.println("Please enter temperature in Farenheit: ");
            double fahrenheit = scanner.nextDouble();
            double celsius = (5.0/9.0) * (fahrenheit - 32);
            System.out.println("Temperature in Celsius is : " + celsius);
        }

        if (input == 2){
            System.out.print("Please enter temperature in Celsius : ");
            double celsius = scanner.nextDouble();
            double fahrenheit = (9.0/5.0)*celsius + 32;
            System.out.println("Temperature in Fahrenheit is : " + fahrenheit);

        }

    }
}

@@ -356,16 +356,66 @@
 tInt();%0A
+        double celsius;%0A        double fahrenheit;
 %0A%0A      
@@ -420,25 +420,59 @@
     
-if
+switch
  (input
- == 1)%7B%0A
+)%7B%0A            case 1: input = 1;%0A    
     
@@ -546,38 +546,35 @@
 %22);%0A            
-double
+   
  fahrenheit = sc
@@ -597,38 +597,35 @@
 ();%0A            
-double
+   
  celsius = (5.0/
@@ -654,32 +654,36 @@
 2);%0A            
+ 
+   
 System.out.print
@@ -740,35 +740,54 @@
     
-%7D%0A%0A        if (
+        break;%0A%0A            case 2: 
 input =
-=
  2
-)%7B
+;
 %0A   
@@ -787,32 +787,36 @@
  2;%0A            
+    
 System.out.print
@@ -863,38 +863,35 @@
 %22);%0A            
-double
+   
  celsius = scann
@@ -911,38 +911,35 @@
 ();%0A            
-double
+   
  fahrenheit = (9
@@ -964,32 +964,36 @@
 32;%0A            
+   
+ 
 System.out.print
@@ -1044,16 +1044,38 @@
 nheit);%0A
+                break;
 %0A       
@@ -1077,17 +1077,16 @@
       %7D%0A
-%0A
     %7D%0A%7D%0A

Update temperature_conv.java