Project: Transportation (C++)
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. // 1. I don’t understand how ‘cin >> 126’ could result in ‘cout << 24’ in this scenario. // 2. I don’t understand why my coding failed Test Case #1 and #2, which both tell me my output is 24. // Here is my code: int a; int b; a = 26, b = 50; int difference; difference = b - a; cin >> a; cout << difference ;