- 1

What am I doing wrong for this project 11 transportation?

#include <iostream> using namespace std; int main() { //your code goes here cout<<"input"; int input; cin>>input; cout<<"result:"<<input % 50; return 0; }

7th Jan 2022, 6:16 PM
Sam mathis
Sam mathis - avatar
2 Answers
0
Calculate how many EMPTY seats are on the last bus. Your calculation shows how many passengers (i.e., used seats) are on the last bus. Don't print extra text in the input and output. Code Coach is an unforgiving computer. You must follow its instructions exactly. Make your output match the examples perfectly.
7th Jan 2022, 6:28 PM
Brian
Brian - avatar
0
You don't have to print out words, only the answer is needed. Also, as Brian rightly said, your code prints out the number of seats occupied by passengers instead of the number of empty seats as required. Here is how I did it #include <iostream> Using namespace std; Int main() { int num1; cin >> num1; int lastPeople = num1 % 50; int num2 = 50 - lastPeople; Cout << num2 ; return 0; }
7th Jan 2022, 8:36 PM
Tandoh Achiever Teneng
Tandoh Achiever Teneng - avatar