Java (Priority queue Algorthim)

Java (Priority queue Algorthim)
1. First you must create a class to store data about cars to buy Specifically, this class must contain the following information:
i. A unique VIN number (17 character string of numbers and capital letters (but no I (i), O (o), or Q (q) to avoid confusion with numerals 1 and 0)
ii. The car’s make (e.g., Ford, Toyota, Honda)
iii. The car’s model (e.g., Fiesta, Camry, Civic)
iv. The price to purchase (in dollars)
v. The mileage of the car
vi. The color of the car
2. You must write a terminal menu-based driver program (again, no GUI). Specifically, your driver must present the user with the following options:
i. Add a car
1. This will (one at a time) prompt the user for all of the above-listed attributes of a car to keep track of
ii. Update a car
1. This option will prompt the user for the VIN number of a car to update, and then ask the user if they would like to update 1) the price of the car, 2) the mileage of the car, or 3) the color of the car
iii. Remove a specific car from consideration
1. This option will prompt the user for the VIN number of a car to remove from the data structure (e.g., if it is no longer for sale)
2. Note that this mean you will need to support removal of cars other than the minimum (price or mileage) car
i. Retrieve the lowest price car
ii. Retrieve the lowest mileage car
iii. Retrieve the lowest price car by make and model
1. This option will prompt the user to enter (one at a time) a make and model and then return the car with the minimum price for that make and model
i. Retrieve the lowest mileage car by make and model
1. This option will prompt the user to enter (one at a time) a make and model and then return the car with the minimum mileage for that make and model
1. Retrieval operations should not remove the car with minimum price or mileage from the datastructure, just return information about that car. Cars should only be removed via the “remove a specific car from consideration” menu option.
2. To ensure efficiency of operations, you must base your PQ class around the use of heaps with indirection data structures (which make them indexable). Note that operations on either attribute (e.g., retrieve minimum price, retrieve minimum mileage) should be efficient. Take care in selecting your approach to the indirection data structure to account for they types of keys you will need to store and the type and number operations that you will need to perform on it.
3. Because this project requires you to make a number of decisions about how to implement its requirements, you will need to write a documentation file explaining your implementation, and justifying your decisions. Name this file “documentation.txt”. Be sure to describe your carefully document your approach to ease the effort required to trace through your code for grading. Be sure to include descriptions of the runtime and space requirements of your approach and use them in your justification of why you think your approach is the best way to go.

READ ALSO :   Management assignment -2