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..1184e4c 100644 --- a/src/GettingHotInHere.java +++ b/src/GettingHotInHere.java @@ -7,8 +7,24 @@ public class GettingHotInHere { **/ public static void main(String[] args) { // The instantiation code for a Scanner instance. - Scanner scanner = new Scanner(System.in); + Scanner scanboi = new Scanner(System.in); System.out.print("What is the temperature in °F: "); - int number = scanner.nextInt(); + int number = scanboi.nextInt(); + System.out.println(number+"°F"); + double currentCelsius = (number-32) * (5.0/9.0); + System.out.printf("%.6f°C", currentCelsius); + System.out.println( ); + System.out.printf("%.0f°C", currentCelsius); + System.out.println( ); + double added = (2+currentCelsius); + System.out.printf("If it were 2°C warmer it would be: %.6f °C", added ); + //Y°C = (X°F - 32) x (5/9) + /** + * What is the temperature in °F: 50 + * 50°F + * 10.000000°C + * 10°C + * If it were 2°C warmer it would be: 12.000000°C + */ } } diff --git a/src/MrRoboto.java b/src/MrRoboto.java index c576091..41499fc 100644 --- a/src/MrRoboto.java +++ b/src/MrRoboto.java @@ -1,6 +1,8 @@ // 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; + public class MrRoboto { /** * Teaching Mr. Roboto how to listen to us. @@ -8,12 +10,17 @@ public class MrRoboto { **/ public static void main(String[] args) { // The instantiation code for a Scanner instance. - Scanner scanner = new Scanner(System.in); + Scanner scanner = new Scanner(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 + + String tf = scanner.nextLine(); + + System.out.println(domo + tf); + } }