From d7fb9250f90dc3b9a6a5a56b345dbda0fb2208a4 Mon Sep 17 00:00:00 2001 From: Jesus Ruiz Date: Sat, 9 Sep 2023 02:41:27 -0700 Subject: [PATCH] Done with Lab 3 --- .idea/misc.xml | 1 - src/GettingHotInHere.java | 17 +++++++++++++++++ src/MrRoboto.java | 4 +++- 3 files changed, 20 insertions(+), 2 deletions(-) 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..de00e0d 100644 --- a/src/GettingHotInHere.java +++ b/src/GettingHotInHere.java @@ -10,5 +10,22 @@ 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(); + /// Conversion to °F to °C + float conversion = (number - 32) * 5.0f / 9.0f ; + System.out.println(number + "°F"); + System.out.println(conversion + "°C"); + /// Conversion from a floating to a int + int nonFloat = (int) conversion; + System.out.println(nonFloat+ "°C"); + System.out.println("if it were 5°C warner it would be : " + (conversion + 5) + "°C"); + + + + + + + + + } } diff --git a/src/MrRoboto.java b/src/MrRoboto.java index c576091..f648306 100644 --- a/src/MrRoboto.java +++ b/src/MrRoboto.java @@ -12,8 +12,10 @@ public static void main(String[] args) { // 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 response = scanner.nextLine(); + System.out.println(domo + response ); } }