Question: Write the implementation for the following classes specification: RentedVehicle (15 points) Attributes Code: String to identify each vehicle. (max 4 letters) Days: an integer to
Write the implementation for the following classes specification:
RentedVehicle (15 points)
Attributes
Code: String to identify each vehicle. (max 4 letters)
Days: an integer to specify the number of rented days.
Renter: a string to store the data about the customer who rented the vehicle.
Count: count the instantiated objects
Methods
Constructor (default + all-arguments)
set and get methods.
toString(): returns the data about a rented vehicle.
finalize
MountainBike (is-a RentedVehicle ) (30 points)
Attributes
suspension: a String that has the value Front if the bike has a front shock absorber or Dual if the bike has a front and back shock absorber.
totaRentlFees: to store the renting fees of all Mountain bikes.
Methods
constructor (default + all-arguments)
Provide set and get methods.
RentFees: returns the renting fees by charging $7 if the bike has Front suspension and $12 if the bike has Dual suspension for each rented day.
Then a discount is applied as follows:
1- If rented days > 5, 3% discount
2- If rented days > 10, 7% discount
3- If rented days > 15, 10% discount
toString(): returns the data about a mountain bike.
Finalize
Write a program to input and store information about N mountain bikes; N is the first input by the user. (15 points)
The program should do the following information:
Output the count of the mountain bikes and the total rent fees of all mountain bikes (10 points - use the static attributes)
Output the data of the dual suspension mountain bikes who are rented for more than 10 days (15 points - Use one JOptionPane dialog box )
Ask the user to input the name of a person, then output a sorted list of all mountain bikes that were rented by this person. The list should be sorted, A-Z, according to the mountain bikes codes (15 points)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
