Question: Create the class BusStop on the route at the defined position. There is a number of passengers increasing in time awaiting for the bus at

Create the class BusStop on the route at the defined position. There is a number of passengers increasing in time awaiting for the bus at the bus stop.  

Create the class Bus. The bus has the capacity and number of passengers. 

When the bus stops at the bus stop:

- random number of passengers goes out (no more than passengers in the bus)

- available passengers at the bus stop occupy available seats in the bus (do not exceed the capacity).  

Define more classes, data members or methods, if necessary.

Use:

- pointers to the class objects, 

- arrays of pointers to objects 

- dynamic object creation

- passing the pointers to object (or references) as a parameters of methods 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Class for BusStop class BusStop private int position position of the bus stop on the route int passe... View full answer

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 Algorithms Questions!