Question: Java Rental Shop Note: Make sure to thoroughly read through all of the requirements for this project. Specifications will be very strictly enforced through the

Java

Rental Shop

Note: Make sure to thoroughly read through all of the requirements for this project. Specifications will be very strictly enforced through the given unit tests.

You may create a main class for testing any of the classes below.

A. Create an abstract class named SummerSportRental that is to be used with for a summer sports rental shop. The SummerSportRental class must have the properties of newModel which takes on the type boolean, and rentalCost which takes on the type double, and rentalNumber which is an identification number as an long integer.These member variables must all be private!

It also must include the following member functions:

1. equals() which returns true if two SummerSportRental objects have the same rentalNumber.

2. all of the appropriate get/set methods for each of the above member variables. Make sure to have data validation done on the set methods to prevent invalid/illegal values from being passed into the member variables. (Example: rentalCost should not be allowed to be negative).

3. include an abstract method named lateCharge, that will only be implemented in child classes that inherit the SummerSportRental class.

B. Create three children classes that inherit the SummerSportRental class, named WaterSkiRental, PaddleboardRental, and BeachCruiserBikeRental.

The WaterSkiRental class should have one private member variable named size as an integer that will be used to store the size of the water ski in centimeters. Implement the get/set method for this member variable. The abstract method in the SummerSportRental class, named lateCharge must be implemented to charge a late charge of 10% of the rental cost. Be sure to include a method named toString to output the data stored in the member variables for this class. No main method in the class allowed!

The PaddleboardRental class should have two private member variable named size as an integer that will be used to store the size of the paddle board in centimeters, and another member variable named style as an enumerated type with the values (SINGLE, DOUBLE to denote if the paddle board is a single person board or a two person board). Implement the get/set methods for these member variables. The abstract method in the SummerSportRental class, named lateCharge must be implemented to charge a late charge of 20% of the rental cost. Be sure to include a method named toString to output the data stored in the member variables for this class. No main method in the class allowed!

The BeachCruiserBikeRental class should have two private member variable named wheel_szie as an integer that will be used for storing the wheel size in centimeters of the beach cruiser bike, and another member variable named capacity as an enumerated type with the values (SINGLE, DOUBLE, TRIPLE [which has a very stylin' side cart to it]) that stores the seating capacity of the beach cruiser bike. Implement the get/set methods for these member variables. The abstract method in the SnowSportRental class, named lateCharge must be implemented to charge a late charge of (20+capacity*5)% (late charge for single=25%, double=30%, triple=35%) of the rental cost. Be sure to include a method named toString to output the data stored in the member variables for this class. No main method in the class allowed!

C. Create separate test class source files with their respective main methods to test each implemented method in the WaterSkiRental, PaddleboardRental, and BeachCruiserBikeRental classes. The list below is the minimums for the test cases for each of the child classes:

WaterSkiRental:

1. equals() method

2. newModel ( test get and set )

3. rentalCost ( test get and set )

4. rentalNumber ( test get and set )

5. size ( test get and set )

6. lateCharge - make sure it adheres to the specifications above.

7. toString ( test toString method )

A total of 11 tests for WaterSkiRental class ( tests 1-4 are actually for the SummerSportRental class, and will not need to be repeated for PaddleboardRental and BeachCruiserBikeRental class test )

PaddleboardRental:

1. size ( test get and set )

2. style ( test get and set )

3. lateCharge - make sure it adheres to the specifications above.

4. toString ( test toString method )

A total of four tests for PaddleboardRental class

BeachCruiserBikeRental:

1. wheel_size ( test get and set )

2. capacity ( test get and set )

3. lateCharge - make sure it adheres to the specifications above.

4. toString ( test toString method )

A total of four tests for BeachCruiserBikeRental class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!