ICS 111, Introduction to Computer Science
Lab 5 - Integers and Doubles - June 10
Instructions:
Note: The login / password that you signed up for is for using the computers in the lab. This user name / password is only for gaining access to the lab computers, and has nothing to do with logging into UH UNIX. Also, be careful and make sure that you logout from the computers when you leave the lab or other persons may see your stuff or use your account to do "bad" things.
To receive credit for this lab assignment, you must be finished by
Tuesday, June 10, at 11:59 p.m. After this time you will not receive any credit. Future lab assignments will be due by 11:59 p.m. on the day of the lab assignment.1. Login to UNIX (Secure Shell in Windows)
- If you're at home, a good program to use to connect to UNIX
is Putty (click here to download).
The putty program is executable and doesn't need to be installed.
- Host name is: uhunix2.its.hawaii.edu
- Your user name is the first part of your UH e-mail address.
If your UH email address is 'frank@hawaii.edu', your user name would be 'frank'.
Your password is the same as your e-mail password.
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 (Getting Started with Pico), then compile and run the program.
Do the following:
- Write a program to compute the perimeter AND the area of a circle. The emphasis will be in following the JAVA coding standard and formatting a nice output that will tell the user exactly what is going on.
Formulas: (the 'x' means 'times' as in multiplication, and radius squared means r2or r^2)
perimeter = pi x radius
area = pi x (radius squared)
- Before you submit your code, make sure that your code is formatted cleanly. Refer to the Java Coding Standard and make sure your code adheres to its rules. Every time you open a new {, you should indent everything underneath it. For example:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
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.
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...
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.