From 785f729b6a25394cd69c18c498edc786f8cfc812 Mon Sep 17 00:00:00 2001 From: Cassandra Portlock Date: Wed, 27 Sep 2023 13:09:27 -0700 Subject: [PATCH] Completed Lab 003 --- src/GettingHotInHere.java | 20 +++++++++++++++++++- src/MrRoboto.java | 10 ++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/GettingHotInHere.java b/src/GettingHotInHere.java index 7a5b209..c203b0c 100644 --- a/src/GettingHotInHere.java +++ b/src/GettingHotInHere.java @@ -1,14 +1,32 @@ +/** + * + * @author Trevor Hartman + * @author Cassandra Portlock + * + * @since Version 1.0 + * + */ import java.util.Scanner; public class GettingHotInHere { /** * Teaching Mr. Roboto how to listen to us. + * * @param args Command line arguments [The source file path, The target file path, ...] **/ 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(); + int n = scanner.nextInt(); + double c = ((n - 32.0) * (5.0 / 9.0)); + int C = (int) c; + + System.out.println(n + "°F"); + System.out.println(c + "°C"); + System.out.println(C + "°C"); + System.out.println("If it were 2°C warmer it would be: " + (2 + c) + "°C"); + } } + diff --git a/src/MrRoboto.java b/src/MrRoboto.java index c576091..cf4e09b 100644 --- a/src/MrRoboto.java +++ b/src/MrRoboto.java @@ -1,3 +1,11 @@ +/** + * + * @author Trevor Hartman + * @author Cassandra Portlock + * + * @since Version 1.0 + * + */ // Import the Scanner tool used for reading (All external packages/libraries/apis are imported similarly this) import java.util.Scanner; @@ -15,5 +23,7 @@ public static void main(String[] args) { System.out.print("My name is Mr. Roboto, are you Kilroy? "); // Write your program here + String response = scanner.nextLine(); + System.out.println(domo +response); } }