0

Can someone pls explain this problem??

You are making a program for a bus service. A bus can transport 50 passengers at once. Given the number of passengers waiting in the bus station as input, you need to calculate and output how many empty seats the last bus will have. This is my code #include <iostream> using namespace std; int main() { int NumOfPassAvl = 126; int BusCapacity = 50; int Ans1 = NumOfPassAvl - BusCapacity; int Ans2 = Ans1 - BusCapacity; cout << BusCapacity - Ans2; return 0; }

15th Jul 2021, 1:14 PM
Oluwasegun Are
Oluwasegun Are - avatar
1 Antwort
+ 3
Read the hint in the problem statement and use the modulo operator. Instead of hard coding input values use cin. Use the Q&A search bar and search for "transportation". Many others have asked about this Code Coach problem before.
15th Jul 2021, 1:23 PM
Brian
Brian - avatar