/* 9/9/2019 User Input Scanner class */ import java.util.Scanner; public class Celcius { public static void main(String[] args) { double celcius; // prompt the user System.out.println("Enter degrees celcius: "); // read in user input Scanner sc = new Scanner(System.in); // gives us a Scanner object to help read celcius = sc.nextDouble(); System.out.println("You entered: " + celcius); double faran = 9/5.0 * celcius + 32; System.out.println("celcius " + celcius + " is equal to " + faran + " faranheit."); // try wrong input System.out.println("Enter an integer: "); int num = sc.nextInt(); System.out.println("num is " + num); /** If the user types a double value the program will crash (i.e. runtime exception) **. sc.close(); } } /** LAB 3: * modify today's hmwk to read in a weight in lbs, then * convert it to kg, and print dosage. * You only need to do 1 patient, do all 3 if you have time. * Time permitting, open CodeLab and continue. */