Bus Write a program to simulate bus operation. The bus departs from initial stop
ID: 657271 • Letter: B
Question
Bus
Write a program to simulate bus operation. The bus departs from initial stop with certain amount of passengers. After that, the bus will stop three times before it hits final stop. For each stop, there will be some passengers getting on and off the bus. For every single passenger getting on the bus, a fixed amount of money will be charged.
You will need to create a bus object based on each set of input, which will be described in detail in following instructions.
Input
You will be inputting more than one set of FOUR lines The first line contains a fixed route fare, and the number of passengers who get on the bus at the initial stop. For example: 1.50% 4 means the bus fare is 1.50 per passenger, and there are 4 passengers getting on the bus at the first stop.
After that, a bus stops at three bus stops before it hits the final stop. Each line of input represents one stop.
The first number of input is the number of passengers who get on the bus, and the second one is the number of passengers who get off the bus. For example, 2%3 means at certain stop, 2%passengersgetonthebusand3 passengers get off the bus.
Important Note: We assume that passengers on board get off before others can get on, AND it
Explanation / Answer
The below steps might be helpful.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.