We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86566d9 commit 05a6e4cCopy full SHA for 05a6e4c
1 file changed
ch03/TempConvert.java
@@ -0,0 +1,27 @@
1
+
2
+import java.util.Scanner;
3
+ /**
4
+ * Converts centimeters to feet and inches.
5
+ */
6
+ public class TempConvert
7
+ {
8
9
+ public static void main(String[] args) {
10
+ double celsius;
11
+ double fahrenheit;
12
13
+ Scanner in = new Scanner(System.in);
14
15
+ // prompt the user and get the value
16
+ System.out.print("Exactly how many cm? ");
17
+ celsius = in.nextDouble();
18
19
+ fahrenheit = (celsius * 9.0/5.0) + 32;
20
+ System.out.println("Temp in Farenheight is: " + fahrenheit);
21
22
23
24
+ }
25
26
27
0 commit comments