Description

Write a program that tracks the amount of passengers that enter and exit a bus, as well as the amount of stops the bus makes.

The program should prompt the user to enter the amount of passengers that enters the bus and the amount that exits for each stop.

Assume that you know your user and that the will only enter valid entries to your program (what I mean is you do not need to validate your user input……. YET).

Each time a user enters both the amount of passengers entered and exited, the program should then ask if the bus should continue running.

If the user enters ‘n’ for no, the program should display the total amount of passengers currently on the bus and the amount total of stops the bus made. The program should then exit.

If the user enters ‘y’, for yes, the program should continue to ask the user to enter data.

What you should know to create this program:

stream (cout and cin)
declaring variables
Boolean expressions
branching (if/else)
while loop

Sample Solution

This question has been answered.

Get Answer