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 which demonstrates arrays.
- Create an array of 6 strings. This array will be of length 6 with positions 0 through 5.
- The values for these strings will be read from the user.
- Perform the following operations (in order) on the array:
- Print the whole array.
- Print the elements in the even slots.
- Print the elements in the odd slots.
- Add the elements that are numbers.
- Average all the elements that are numbers.
- To determine if an element is a number try using parseDouble.
- All non-numerical elements should be ignored for the sum and average steps.
- The program can be implemented in one class, but should have seperate methods for the required operations.
- 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.
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.