+ 1
Please create the program for below
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. Sample Input: 126 Sample Output: 24 Explanation: The first bus will transport 50 passengers, leaving 126-50=76 in the station. The next one will leave 26 in the station, thus, the last bus will take all of the 26 passengers, having 50-26=24 seats left empty. I tried hard but i couldn't solve the problem. Yes i know to use remainder and then subtract value from 50.but it shows an error or wrong output
2 Réponses
+ 9
This is a practise problem from the C++ course only and *you* need to complete it, not someone else.
I can give you the hint:
If you divide the input by 50, the remainder you will get is the number of people travelling in last bus. Now there are 50 seats in a bus, and you have the number of people travelling in the last bus. I think calculating the number of empty seats is easy now.
0
No one else solve it for you.
You should work hard to solve yourself.
Try logic games and quizzes, download apps from internet.
Do your best and have a rest😃