Question: 1 Class Design In this step you must write the methods to complete a Bus class. Assume that the Passenger class has already been written

1 Class Design In this step you must write the methods to complete a Bus class. Assume that the Passenger class has already been written Each bus has a capacity. A default constructor should initialize the capacity to 40, and another constructor should allow the programmer to specify any positive capacity An addPassenger (Passenger p) method should add the given Passenger object to the bus. Passengers can't be added if the bus is full. Hint: what new member variable is needed? A numberOfPassengers() method should return the current number of Passengers on board the bus
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
