Question: this is in Java!! 3) (40 pts) Your last task is to implement a simple BusGarage class in Java to represent the presence of a

this is in Java!!

this is in Java!! 3) (40 pts) Your last task is to

3) (40 pts) Your last task is to implement a simple BusGarage class in Java to represent the presence of a quantity of identical buses within a storage facility (garage). It must have the following variables and methods: int currentBusCount: how many buses a given garage currently holds int maxBusCapacity: the maximum number of buses a given garage can hold BusGarage(int maxCount): Constructor that initializes the maxBusCapacity of a new garage equal to maxCount and sets the garage to be initially empty. departure(): A simple method that removes a single bus from a garage. Will only apply the change if the garage is not empty. Otherwise a message should be printed that the garage is empty and the addition is to be ignored. arrival(): Mirrors the departure method but instead adds a single bus to a garage. In this case, the change will only be applied if the resulting count does not exceed the garage's max capacity. If it does, a message that the garage is full should be printed instead. toString(): Should display the garage's current bus count and max capacity in a user-friendly format (e.g. This garage currently holds 10 of a max 20 buses.") Note: you can assume only positive integers will be used in the above methods

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!