We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef7ee35 commit 8d4ca76Copy full SHA for 8d4ca76
src/org/launchcode/java/demos/TempConverter.java
@@ -0,0 +1,19 @@
1
+package org.launchcode.java.demos;
2
+
3
+import java.util.Scanner;
4
5
+public class TempConverter {
6
+ public static void main(String[] args) {
7
+ double fahrenheit;
8
+ double celsius;
9
+ Scanner input;
10
11
+ input = new Scanner(System.in);
12
+ System.out.println("Enter the temperature in Fahrenheit: ");
13
+ fahrenheit = input.nextDouble();
14
+ input.close();
15
16
+ celsius = (fahrenheit - 32) * 5/9;
17
+ System.out.println("The temperature in Celsius is: " + celsius + "°C");
18
+ }
19
+}
0 commit comments