Question
Using eclipse Java oxygen A Used Vehicle Shop sales cars and motorcycles of different models. The owner asks for an application that can help the
Using eclipse Java oxygen
A Used Vehicle Shop sales cars and motorcycles of different models. The owner asks for an application that can help the shop to do the following tasks on the Unsorted Optimized Array Structure and also apply Object Oriented Design with Inheritance and Polymorphism.
1. Insert a car or a motorcycle
2. Test for the encapsulation of the data structure
3. Remove a car or a motorcycle
4. Update information of a car or a motorcycle
5. Show All vehicles The output of a car or a motorcycle as below:
The cars information is displayed as below (for example)
VIN: 123A456B
Color: White
Year: 2014
Car make: Toyota
Model: Sienna
Number of passengers: 8
Number of doors: 4
The motocycles information is displayed as below (for example)
VIN: 321BC654
Color: Grey
Year: 2015
Motocycle make: Honda Model: PCX150
Has side car: no
After finishing each task from the menu, the application should allow users to continue do other tasks. The application only terminates when users select exit
TASK INSERT -Display the message: *** TASK: INSERT and FETCH A CAR OR A MOTOCYCLE ***
-Allow users to enter the information of a vehicle that can be a car or a motorcycle from the keyboard. Insert the vehicle to the data structure
-Fetch the information of vehicle by its VIN from the data structure that have entered to the structure to ensure that the vehicle is in the structure
TEST FOR ENCAPSULATION
-Display the message: *** TASK: TEST FOR DATA ENCAPSULATION ***
-Create a test vehicle with the information entered from the keyboard:
-Insert this test vehicle to the data structure
-Modify the the color of the test vehicle with different color
-Compare the color of test car/test motorcycle with the vehicle fetched from data structure with the same VIN If the colors are the same: display the message box Unsorted Optimized Array structure is unencapsulated If the colors are different: display the message box Unsorted Optimized Array structure is encapsulated
TASK UPDATE -Display: ***TASK: UPDATE INFORMATION OF A CAR OR A MOTOCYCLE ***
-Fetch an existing vehicle from the data structure
-Display message and read the new color that users want to change
-Modify the color of that vehicle with the new color
-Update the data structure with with the vehicle with new color
- Fetch the vehicle with the same VIN. If the color is changed, display message box: Update successfully; otherwise display the message box Update failed
TASK DELETE -Display: *** TASK: DELETE A CAR OR A MOTOCYCLE ***
-Ask user the VIN of vehicle to delete
-Delete that vehicle.
-If delete successfully, display message box The vehicle is removed; otherwise display the message box Cannot find the vehicle
TASK SHOW ALL -Call showAll to display all vehicles on the data structure, ensure display cars or motorcycles with all their information
NOTE: four classes: three data type classes, one data structure class and one driver class -create the parent class name 1) Vehicle 2)Car 3)Motorcyclewill be subclasses of Vehicle class -We need data structure class 4) UnsortedOptimizedArray
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started