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.

13 changes: 13 additions & 0 deletions src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,18 @@ 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();
double temp = (number - 32) * ( 5.0 / 9.0);
//print the temp user put in as a string
System.out.println(number + "°F");
//print the converted temp
System.out.println(temp);
//print the converted as a int
//String temp2 = String.format("%.0f",temp);

System.out.printf("%.6f°C%n",temp);
//print the converted If it were 2°C warmer
double warmer = temp + 2.0;
System.out.println("If it were 2°C warmer it would be: " + warmer + "°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
//scanned the users input ending at the enter key
String text = scanner.nextLine();
}
}