diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..b95853c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/src/GettingHotInHere.java b/src/GettingHotInHere.java index 7a5b209..7cfcdcc 100644 --- a/src/GettingHotInHere.java +++ b/src/GettingHotInHere.java @@ -9,6 +9,14 @@ public static void main(String[] args) { // The instantiation code for a Scanner instance. Scanner scanner = new Scanner(System.in); System.out.print("What is the temperature in °F: "); - int number = scanner.nextInt(); + // Assign user input to numberF + int numberF = scanner.nextInt(); + System.out.println(numberF + "°F"); + // Convert user input to Celcius and assign it to numberC + double numberC = (numberF - 32) * (5.0/9.0); + System.out.println(numberC + "°C"); + // Print numberC as an integer rather than a floating point + System.out.println((int)numberC + "°C"); + System.out.println("If it were 2°C warmer it would be: " + (numberC + 2.0) + "°C"); } } diff --git a/src/MrRoboto.java b/src/MrRoboto.java index c576091..c8700f3 100644 --- a/src/MrRoboto.java +++ b/src/MrRoboto.java @@ -15,5 +15,7 @@ public static void main(String[] args) { System.out.print("My name is Mr. Roboto, are you Kilroy? "); // Write your program here + String userInput = scanner.nextLine(); + System.out.println(domo + userInput); } }