Java Lab 2
Java Lab 2
Create a new Java file (empty Java file), save it to your H: drive, call it lab2
Insert the following code to set up your program:
import java.util.Scanner;
m = ft/3.28
Allow the user to enter the feet value. Store both the feet value and the answer as an
integer variable, and then print the answer.
C = (F – 32) * 5/9
Allow the user to enter the Fahrenheit value using the Scanner class. Store both the
Fahrenheit value and the answer as an integer variable, and then print the answer.
Test Values:
Fahrenheit Celcius
1 -17.22
100 37.77
-459.4 -273
Feet Meters
6 1.82
12 3.65
300.5 91.6