1. Login to UNIX
2. Create and edit a file called 'LabX.java' (substitute the lab number
for X- where is the number of the lab- such as 'Lab1.java') in Pico, then compile and run the program.
Do the following:
- Write a program to convert temperature from Farenheit to Celsius or vice versa.
- Display the following menu:
--Degree Conversion Program--
1. Transform Farenheit to Celsius
2. Transform Celsius to Farenheit
0. Exit
Your choice??
- If the user selects 1, he/she will be prompted to enter the temperature in Farenheit to be converted to Celsius.
- If the user selects 2, he/she will be prompted to enter the temperature in Celsius to be converted to Farenheit.
- If the user enters a 0, the program will end.
- Make sure to validate all user input (menu input, degree input).
- The program must loop until the user chooses to exit. Do not exit if the user enters invalid information.
- Use the following formulas:
C = 5 * (F-32)/9
F = 1.8 * C + 32
Where C is degrees Celsius and F is degrees Farenheit.
- All the information should be validated (catch the possible
NumberFormatExceptions)
- Note: If the program doesn't compile or if the program crashes
you will get no credit
- Use javadoc style to write your program:
Refer to the Java Coding Standard and make sure your code adheres to its
rules.
3. Get into Pine and attach the file to an e-mail and send the e-mail /
file to the ics111-lab@hawaii.edu account.
- Your e-mail should have the following subject: labX / lastname /
section (X should be substituted for the lab number [such as lab 1], lastname should be substituted for your lastname, section
should be substituted with the A for the afternoon section and M for the
morning section) Not following this standard will result in a deduction
of points.
- control <J>, then control <T> allows you to browse and pick the file that you wish to attach
4. Check the webpage to make sure that the e-mail arrived.
Here is the URL:
http://www2.hawaii.edu/~tp_200/bmf/ics111-lab.html
5. Once I (TA) get the e-mail in my account AND I can verify it on the web,
you will receive your lab participation point. For
grading policies on your lab, click here...
6. Hints.
Use doubles to avoid truncation issues with integers.
Do not worry about rounding numbers to display a certian number of decimal places.
This lab is due on Saturday not Thursday due to the midterm.
Link to the Java
API - to look up any methods of any class you would like to use.
Link to the
Java Coding Standard - to look up Java code formatting rules.