1. Log in to UH UNIX (Secure Shell in Windows)
or (Putty)
and create a Java application that fulfills the following requirements:
- Write a class Car with the following instance variables:
String sPlates //it must be of length 6 non-blank characters
int iVin //vehicle identification number must be a number between 10000 and
100000.
String sMake //at least 3 non blank characters
String sModel //at least 3 non-blank characters
int iYear // must be a year from 1950 to 2006
- Write the following methods:
-gets for all instance variables
-sets for all instance variables
-equals comparing all the instance variables
-toString for a printable version of the object
- You will create a class CarException
this exception will prevent anyone from creating or modifying the car into
an invalid state.
- You will create a class CarSales
This will have a main method that will run the following menu.
1. Add a new car
2. Modify car VIN
3. Modify car license plates
4. Modify car year
5. Modify car Make
6. Modify car Model
0. Exit
- When the car is added, you should allow the user to give you information
about a car.
- If the user selects an option from 2 to 6 without adding a car first you
should send an error message
- Every time that a modification is performed you should print the car
object so that the user can see that the updates took place.
- This will be done inside a loop. The user can modify the car as many
times as he/she wants. Once he/she is done she will select exit from your
menu.
- If after adding a car the user selects option 1 again you should give a
warning telling the user that the car that he/she had previously added will
be overwritten by this new car. If the user decides to continue then do so.
- You need to write comments using
the
JAVA coding standard - failure to do so will result
in up to a 30% deduction from your score.
2. Open Pine (Getting
Started with Pine, PDF) and send an email with the file attached to ics111-lab@hawaii.edu account.
- Your e-mail should have the following subject: lab X / lastname (substitute
the lab number for 'X', and lastname should be substituted for your lastname) Not following this standard will result in a deduction
of points.
- SEND ALL YOUR .JAVA FILES (ATTACHED) TO THE EMAIL.
3. Check the webpage to make sure that the e-mail arrived at
http://www2.hawaii.edu/~tp_200/bmf/ics111-lab.html
For
grading policies on your lab, click here...