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.

12 changes: 12 additions & 0 deletions src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,17 @@ 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();

System.out.print("Enter temperature in °F: ");
double fahrenheit = scanner.nextDouble();
double celsius = (fahrenheit - 32) * 5 / 9;
int celsiusInt = (int) celsius; // Convert to integer
double warmerCelsius = celsius + 2;

System.out.println(fahrenheit + "°F");
System.out.printf("%.6f°C\n", celsius); // Print as a floating point number with 6 decimal places
System.out.println(celsiusInt + "°C");
System.out.println("If it were 2°C warmer it would be: " + warmerCelsius + "°C");

}
}
3 changes: 3 additions & 0 deletions src/MrRoboto.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ public static void main(String[] args) {

System.out.print("My name is Mr. Roboto, are you Kilroy? ");
// Write your program here
System.out.print("Enter a line of text: ");
domo = scanner.nextLine(); // Use the scanner instance to read a line of text
System.out.println("Domo arigato " + domo); //Print the user's
}
}