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..e4fcc05 100644 --- a/src/GettingHotInHere.java +++ b/src/GettingHotInHere.java @@ -10,5 +10,13 @@ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("What is the temperature in °F: "); int number = scanner.nextInt(); + System.out.println(number + "°F"); + + double y = (number-32.0)*(5.0/9.0); + System.out.println(y + "°C"); + int newY = (int) y; + System.out.println(newY + "°C"); + System.out.println("If it were 2°C warmer it would be: " + (2+newY) + "°C"); + } } diff --git a/src/MrRoboto.java b/src/MrRoboto.java index c576091..faecb7c 100644 --- a/src/MrRoboto.java +++ b/src/MrRoboto.java @@ -1,6 +1,9 @@ // Import the Scanner tool used for reading (All external packages/libraries/apis are imported similarly this) import java.util.Scanner; +import static java.lang.System.in; +import static java.lang.System.setOut; + public class MrRoboto { /** * Teaching Mr. Roboto how to listen to us. @@ -8,12 +11,20 @@ public class MrRoboto { **/ public static void main(String[] args) { // The instantiation code for a Scanner instance. - Scanner scanner = new Scanner(System.in); + // Concatenate the user response to this String. String domo = "Domo arigato "; - System.out.print("My name is Mr. Roboto, are you Kilroy? "); + // Write your program here + Scanner scanner = new Scanner(in); + System.out.print("My name is Mr. Roboto, are you Kilroy? "); + String line = "No, I'm Stan"; + + String input = scanner.nextLine(); + System.out.println(domo + line); + } + }