Question: Q 1 g ) ( 1 0 pts ) Create the following class Bicycle class Bicycle extends Vehicle implements Comparable weight: double Bicycle ( )
Q g pts Create the following class Bicycle
class Bicycle extends Vehicle implements Comparable
weight: double
BicycleSEE NOTE
BicyclePerson driverSEE NOTE
BicyclePerson driver, double weightSEE NOTE
equalsObject o: boolean same weight. ACCURACYRANGE SEE NOTE
getWeight: double
setWeightdouble w: void
setDriverPerson p: void throws InvalidDriverException SEE NOTE
toString: String Bicycle rider getDrivergetName weight weight
compareToBicycle bACCURACYRANGE SEE NOTE
Notes for Bicycle class:
This constructor calls the parent classs constructor, passing in for the numRows and for the numSeatsPerRow before initializing weight to
This constructor calls the parent classs constructor, passing in the specified driver and an array specifying that there is only one row with one seat,before initializing weight to
This constructor calls the parent classs constructor, passing in the specified driver and an array specifying that there is only one row with one seat, before setting the weight. Negative weight not permitted, set to if that occurs
Two bicycle objects are considered equal if their weights are within of each other regardless of who the driver is
Override the inherited setDriver method so that any Person age or older can be the driver of the Bicycle. If the driver is younger than throw an InvalidDriverException
If the calling objects weight is less than the passed in objects weight by more than the ACCURACYRANGE return If the calling objeQ g pts Create the following class Bicycle
class Bicycle extends Vehicle implements Comparable
weight: double
BicycleSEE NOTE
BicyclePerson driverSEE NOTE
BicyclePerson driver, double weightSEE NOTE
equalsObject o: boolean same weight. ACCURACYRANGE SEE NOTE
getWeight: double
setWeightdouble w: void
setDriverPerson p: void throws InvalidDriverException SEE NOTE
toString: String Bicycle rider getDrivergetName weight weight
compareToBicycle bACCURACYRANGE SEE NOTE
Notes for Bicycle class:
This constructor calls the parent classs constructor, passing in for the numRows and for the numSeatsPerRow before initializing weight to
This constructor calls the parent classs constructor, passing in the specified driver and an array specifying that there is only one row with one seat,before initializing weight to
This constructor calls the parent classs constructor, passing in the specified driver and an array specifying that there is only one row with one seat, before setting the weight. Negative weight not permitted, set to if that occurs
Two bicycle objects are considered equal if their weights are within of each other regardless of who the driver is
Override the inherited setDriver method so that any Person age or older can be the driver of the Bicycle. If the driver is younger than throw an InvalidDriverException
If the calling objects weight is less than the passed in objects weight by more than the ACCURACYRANGE return If the calling objects weight is greater than the passed in objects weight by more than the ACCURACYRANGE return Otherwise return ;
Be sure to implement the loadPassenger, and loadPassengers methods in the Bicycle class. Hint: A Bicycle cannot have any passengers. A driver is not a passenger
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
