0
i have a problem can anyone help me??
Hello guys✋🏻... when i'm doing project 1 in c++ always says try again and i don't understand what is wrong!!!😥 ...i think my code is right(i tested it in my pc and he is runed) but i shoucld enters value for variable ,but when i runing it he enter valu from himself (i mean input and also output It assumes it from himself )...so please, if anyone can help me and explaine it for me🙏🏻🙏🏻
3 Answers
+ 2
Show your code here so we will be able to tell you what's wrong
0
Ok
This is my code 👇🏻
#include <iostream>
using namespace std;
int main() {
//your code goes here
int x,y,z ;
cout<<"the bus can transport 50 passengers \n";
cin>>z;
cout<<"the number of passengers = "<<z<< "\n";
x= z-50;
cout<<"a number of passengers remaind at station ="<<x<<"\n";
y=50%26;
cout<<" empty seats from the last bus ="<<y;
return 0;
}
Is anything wrong in my code??🤔
0
Well, yes, you should output the number of "empty seats" in the last bus. There are no passengers left on the station. For example, if total number of passengers is 134, then these people will be forced to use three buses, and two of them will be fully packed. The last one will contain the rest 34 people, so 16 seats will be empty. What you should print here is just "z%50", which is remainder of division by 50 - in this example equal 16, the number of empty seats. I hope it helps you somehow



