Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 14 additions & 3 deletions src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

public class GettingHotInHere {
/**
* Teaching Mr. Roboto how to listen to us.
* @param args Command line arguments [The source file path, The target file path, ...]
* @author Olivia McKittrick
* Teaching Mr. Roboto how to listen to us.
**/
public static void main(String[] args) {
// The instantiation code for a Scanner instance.
Scanner scanner = new Scanner(System.in);
Scanner scanner = new Scanner(System.in); // The instantiation code for a Scanner instance.
System.out.print("What is the temperature in °F: ");

int number = scanner.nextInt();

double celsius = (double) ((number - 32) * 5) / 9;

System.out.printf("%.0f°F%n", (double) number); // Displays °F without a decimal
System.out.printf("%.6f°C%n", celsius); // Displays °C with a decimal
System.out.printf("%.0f°C%n", celsius); // Displays °C without a decimal

double warmerCelsius = celsius + 2;
System.out.printf("If it were 2°C warmer it would be: %.6f°C%n", warmerCelsius);
}
}

10 changes: 7 additions & 3 deletions src/MrRoboto.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Import the Scanner tool used for reading (All external packages/libraries/apis are imported similarly this)
import java.util.Scanner;

public class MrRoboto {
public class
MrRoboto {
/**
* Teaching Mr. Roboto how to listen to us.
* @param args Command line arguments [The source file path, The target file path, ...]
Expand All @@ -10,10 +11,13 @@ 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
String name = scanner.nextLine();
System.out.print(domo + name);

}
}