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.

9 changes: 8 additions & 1 deletion src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ 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 number = scanner.nextInt(); // gets the input
float celsius = (number-32)*5/9; //converts to celsius
int celsiusInt = Math.round(celsius); //converts floating type to integer to drop the unecessary zeros.
float warmer = celsius+2; //calculates for "If warmer" output
System.out.println(number+"°F"); //the following outs display all that we've calculated
System.out.println(celsius+"°C");
System.out.println(celsiusInt+"°C");
System.out.println("If it were two degree's warmer it would be: " + warmer +"°C");
}
}
6 changes: 5 additions & 1 deletion src/MrRoboto.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ 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? ");
System.out.print("My name is Mr. Roboto, are you Kilroy? \n");
// Write your program here

String userName = scanner.nextLine(); //waits for input

System.out.print(domo + userName);
}
}