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.

20 changes: 18 additions & 2 deletions src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,24 @@ public class GettingHotInHere {
**/
public static void main(String[] args) {
// The instantiation code for a Scanner instance.
Scanner scanner = new Scanner(System.in);
Scanner scanboi = new Scanner(System.in);
System.out.print("What is the temperature in °F: ");
int number = scanner.nextInt();
int number = scanboi.nextInt();
System.out.println(number+"°F");
double currentCelsius = (number-32) * (5.0/9.0);
System.out.printf("%.6f°C", currentCelsius);
System.out.println( );
System.out.printf("%.0f°C", currentCelsius);
System.out.println( );
double added = (2+currentCelsius);
System.out.printf("If it were 2°C warmer it would be: %.6f °C", added );
//Y°C = (X°F - 32) x (5/9)
/**
* What is the temperature in °F: 50
* 50°F
* 10.000000°C
* 10°C
* If it were 2°C warmer it would be: 12.000000°C
*/
}
}
9 changes: 8 additions & 1 deletion src/MrRoboto.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
// Import the Scanner tool used for reading (All external packages/libraries/apis are imported similarly this)
import java.util.Scanner;

import static java.lang.System.in;

public class MrRoboto {
/**
* Teaching Mr. Roboto how to listen to us.
* @param args Command line arguments [The source file path, The target file path, ...]
**/
public static void main(String[] args) {
// The instantiation code for a Scanner instance.
Scanner scanner = new Scanner(System.in);
Scanner scanner = new Scanner(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 tf = scanner.nextLine();

System.out.println(domo + tf);

}
}