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
1 change: 0 additions & 1 deletion .idea/misc.xml

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

10 changes: 9 additions & 1 deletion src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ 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();
// Assign user input to numberF
int numberF = scanner.nextInt();
System.out.println(numberF + "°F");
// Convert user input to Celcius and assign it to numberC
double numberC = (numberF - 32) * (5.0/9.0);
System.out.println(numberC + "°C");
// Print numberC as an integer rather than a floating point
System.out.println((int)numberC + "°C");
System.out.println("If it were 2°C warmer it would be: " + (numberC + 2.0) + "°C");
}
}
2 changes: 2 additions & 0 deletions src/MrRoboto.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public static void main(String[] args) {

System.out.print("My name is Mr. Roboto, are you Kilroy? ");
// Write your program here
String userInput = scanner.nextLine();
System.out.println(domo + userInput);
}
}