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
20 changes: 19 additions & 1 deletion src/GettingHotInHere.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,30 @@
public class GettingHotInHere {
/**
* 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);
System.out.print("What is the temperature in °F: ");
int number = scanner.nextInt();

// fTemp = the temperature in Fahrenheit as an int.
int fTemp = scanner.nextInt();
System.out.println(fTemp+"°F");

//equasion for converting Fahrenheit to Celsius as a floating point number.
double yCel = (fTemp-32.0)*(5.0/9);

// print double of Celsius temperature.
System.out.printf("%.6f°C%n",yCel);

//print int of Celsius temperature.
System.out.println((int)yCel+ "°C");

//print Celsius temperature + 2 degress as a floating point number.
String plusTwo = "If it were 2°C warmer it would be: ";
System.out.print(plusTwo);
System.out.printf("%.6f°C%n",yCel);
}
}
15 changes: 10 additions & 5 deletions src/MrRoboto.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ public class MrRoboto {
public static void main(String[] args) {
// The instantiation code for a Scanner instance.
Scanner scanner = new Scanner(System.in);

// Concatenate the user response to this String.
String domo = "Domo arigato ";

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


String ddomo = ("My name is Mr. Roboto, are you Kilroy? no, I'm stan ");

String ari = ("Domo arigato no, I'm stan");

System.out.println(ddomo+"\n"+ari);
System.out.println(myName);
}
}
}