The program will also include the member functions to


A C++ program that creates a Bus class that includes a bus ID number, number of seats, driver name, and current speed.Must a default constructor with three parameters of bus id number, number of seats, and driver name. Car speed should always be initialized as 0.

The program will also include the member functions to perform the various operations: modify, set, and display bus information (Bus id, number of seats, driver name, and current speed)

For example:

 - Set the bus id number

 - Set the number of seats

 - Set of driver number

 - Return the bus id number by using get method

 - Return the number of seats

 - Return of driver number

 - Return the current speed

 Member function to display the bus information

 - busInformation()

Also write two member functions, Accelerate() and Brake(). Whenever Accelerate() is called, increase the speed by 5 (cannot exceed 50), and whenever Brake() is called, decrease the speed by 5 (cannot be negative).  Write a program that declares several Bus objects and demonstrates that all the functions work correctly.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: The program will also include the member functions to
Reference No:- TGS02397583

Now Priced at $30 (50% Discount)

Recommended (91%)

Rated (4.3/5)