Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Worlds Greatest Cost Effective Healthy Green Fashionable Transportation Solution Downtown Dallas, Texas has seen an explosion in a demand for bicycle rentals.You have decided

The Worlds Greatest Cost Effective Healthy Green Fashionable Transportation Solution Downtown Dallas, Texas has seen an explosion in a demand for bicycle rentals.You have decided to go into the bicycle rental business to satisfy the worlds desire for cost effective healthy green transportation. Market studies have shown that hundreds of billions of people are interested in renting bicycles which will result in a huge number of rentals from your bicycle rental stores.

You need to develop a program that calculates the rental charge for a bicycle rental based on the number of days the bicycle is rented and the bicycle type.

You must use the following package name for developing the java program:

package biclyclerentalstorepackage;

There must be at least 2 java source code files that have the following names:

? BicycleRentalStoreMainClass.java

Contains the main BicycleStoreMainClass.

? BicycleRentalClass.java

Contains the BicycleRentalClass base class and the extended classes based on bicycle type.

The program must create and use at least an amount of bicycle objects for each type of bicycle.

If you do not use this assignments stated file names, class names, method names, variable names and package name, the assignment is an invalid submission and will be graded a 0%.

This program introduces inheritance by creating subclasses of a BicycleRentalClass based on bicycle type. Your program design solution will override the equals() and calculateRentalFees() methods in the extended classes.

BicycleStoreMainClass

Define a base class named BicycleStoreMainClass.

This class has the following for global member instance variables:

? BICYCLE_TYPE_ENUM

This class must have a global enum type named BICYCLE_TYPE_ENUM that has the following enum values:

STANDARD, RACER, MOUNTAIN, BMX

? DAILY_BICYCLE_RENATL_RATES_CLASS

A data class that holds the rate schedule for bicycle rental. Each class member is a public static final double.

RENTAL_DAILY_FEE_STANDARD = 1.00

RENTAL_DAILY_FEE_RACER = 1.50

RENTAL_DAILY_FEE_MOUNTAIN = 1.79

RENTAL_DAILY_FEE_BMX = 1.89

The BicycleStoreMainClass base class must include the following methods ?

main()

Write a main method test driver class, a concept that is demonstrated in the book, to test BicycleRentalClass class. The main method test driver must test all paths of the logic flow and conditions of the program to validate program correctness. Do not use JPanel or interactive prompts, unit test the BicycleRentalClass by coding in test scenarios in the main program which will act as a test driver.

The main unit test driver must display information that indicates what is being tested with the test values being used, and display a result output of the test. The output must be well formatted and readable to the user running the program. The main test unit driver does not have to output if the test passed or failed, just the test values used for each test and the result.

You will lose points if the main method class does not do comprehensive path testing of the program.

BicycleRentalClass (base class)

Define a base class named BicycleRentalClass.

This class has the following for private member instance variables:

? bicycleId - Each bicycle should have an identification number

? bicycleType - An enum type of BICYCLE_TYPE.

? bicycleRentalFee - Rental Fee per day of Rental, cannot be negative, the rental fee must 0 or greater expressed in US currency with cents. Zero may be used for promotional rental days.

The BicycleRentalClass base class must include the following methods

? A constructor

BicycleRentalClass (int bicycleId, BICYCLE_TYPE_ENUM bicycleType)

? Accessor (Getter) and Setter methods for all member instance variables

public int getbicycleId()

public void setbicycleId(int bicycleId)

public BICYCLE_TYPE_ENUM getbicycleType()

public void setbicycleType(BICYCLE_TYPE_ENUM bicycleType)

? Calculate rental Fees Fees method

public abstract double calculateRentalFees(int daysToRent);

This method has a parameter that indicates the number of days the bicycle is to be rented. This method returns a double by method name the rental charge.

? An equals method

public boolean equals( BicycleRentalClass otherBicycleRentalClassObj )

This method has a parameter that indicates the other object to be compared. This method returns a boolean double by method name the boolean result of the comparison by bicycleId comparison.

Extended Classes of BicycleRentalClass

The extended classes (derived classes) of the base BicycleRentalClass that have the following names:

? BicycleRentalStandardClass

? BicycleRentalRacerClass

? BicycleRentalMountainClass

? BicycleRentalBmxClass

? BicycleRentalTandemClass

The extended classes each include the following methods:

? A constructor

This constructor must use super constructor to invoke the base BicycleRentalClass class constructor.

BicycleRentalStandardClass (int bicycleId, BICYCLE_TYPE_ENUM bicycleType)

super(bicycleId, bicycleType)

? An overridden method

public double calculateRentalFees(int daysToRent)

This method has a parameter that indicates the number of days the bicycle is to be rented. This method returns by method name the rental charge. In each extended class this method uses override to calculate the rental charge fee based on the appropriate fee for the class bicycle type.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions