Introduction
In this assignment the student will make a simple database for a car dealership. The user will be able to add cars, delete cars, search for cars with certain characteristics, and display results clearly. In this assignment the student will design several classes, using one file per class.
Procedure
For this assignment the following classes are required:
Car implements Comparable Cloneable // Do this first; it is easy. These are the minimum required.
Has private String fields for model, color, int year, int vin number and double price.
Has a default constructor (a forklist or go-cart) and has a 5 parameter constructor.
Has a toString() method which returns the model and year for example.
Has a compareTo() method based on model name.
Has a clone method.
CarLot // This is similar to the StacksAndQueues from last assignment.
Must have at least two for loops and two iterators.
Has static methods taking a LinkedList input to:
1 - display all the cars in
alphabetical order with headings, one line per car. (Collections.sort(x))
2 - display the car info given a vin
number
3 - list the first two cars of the
same model (use compareTo)
4 - update inventory (add, delete and
modify a car). Implement the code for one and display only a message for the
other two.
5 - display the total value of cars in the lot.
6 - shallow clone the list. (documentation
will describe it)
7 - deep clone the list. (documentation
will describe it)
Note: these methods will use only the linked list data structures.
UseCarLot // The test cases!
All methods in the CarLot class to be
verified with output.
You can hard code a few cars and add to a linked list. Pass this
list to the CarLot class when ready.
You may want to add additional setters and getters to enable
adequate testing of the cars in CarLot.
A for loop to allow additional inputs for testing can be
used, and will have a termination mechanism.
Sufficient valid data testing and sufficient invalid data
testing will be done to ensure correct operation. This will be documented as
usual.
The clone tests will be create the clone ;test sameness; modify
data(modify one car?, add one car?); test for cloneness
Menu // You decide how to implement the menu concept to do something like this.
Prompts the user with a choice of actions. The actions are the seven methods of CarLot plus exit.
Returns the choice (char?, int?) back to main for execution.
Suggest using a Singleton class -> public static final
Appropriate action forwarded to CarLot object for execution.
When you add the IO.java class, DO NOT copy the
file into your carlot folder. Add an existing copy of the file to the project
and add the appropriate directory path to the CLASSPATH variable.
Other // You may decide to have additional classes.
Documentation
1. Demonstrate the code to the instructor.
2. Source code for all your classes. Javadoc style comments for all public methods except
setters and getters.
3. The usual proof of operation for all methods with sufficient valid data and
sufficient invalid data. Clearly label proofs of methods.
4. Note all error checking, errors and bugs.
Evaluation
The FULLY working programme is worth 40%. The rest is Car-1, CarLot-1, UseCarLot-1, Menu-1, data-2.
Revision: November 03, 2014
© 2014, PrintUpon