0
I need help with the first C++ coding challenge
I believe I have the right code because the output matches the results I output however it is still finding errors somehow. I am not sure what is wrong. #include <iostream> using namespace std; int main() { //your code goes here int passTotal; int busLoad = 50; cout << "Please enter the number of passemgers waiting"; cin >> passTotal; int seatsLeft = busLoad - passTotal % 50; cout << "There are " << seatsLeft << " seats left on the bus"; return 0; }
7 odpowiedzi
+ 5
You need to print only the number of seats left. I mean,
cout << seatsLeft;
+ 1
You can see clearly there that it asking to print only 'seatsLeft'.
None of any extra charecters..!!!
Comment or remove 1st and 2nd couts and Brian
put just
cout<<seats left;
0
Pls post problem description also.
Along with your expected output and your output...
Is it code coach problem?
0
Yes, it is a code coach problem. Test case 1: input 12,
my output: Please enter the number of passengers waiting38
expected output: 38
test case 2: input: 231
my output: Please enter the number of passengers waiting19
output: 19
0
Brian
Just print value because test cases only understand that. Wherever you have written except value doesn't understand.
0
Brian
Your code is right except other printed text.
0
Check the comments if the challenge man , you'll find more help there