+ 3

Transportation quiz

I have no idea how to write the answer in the c++ language

12th Apr 2021, 2:30 PM
J A M E S
J A M E S - avatar
5 odpowiedzi
+ 2
As for some feedback to the question I thought we were trying to take x= 126 % 50. Then 50 - x to solve the specific question and problem. I didn't understand that the bus station wanted to input whatever number they wanted to get the remainder of seats. So the results saying "input num, your output, expected output. Was like HUH? What the? Now I come here and read all I needed was Cin and let the user input a value and everything is all fixed up with the perfect end result.
28th Sep 2021, 1:53 PM
Darkhost
Darkhost - avatar
+ 2
first try to understand the question items of logic and math #include <iostream> using namespace std; int main() { //your code goes here int v=50; int y; cin >> y; int z=50-(y%50); cout << z; return 0; }
24th Dec 2021, 2:33 PM
Temesgen Tesfaye
Temesgen Tesfaye - avatar
0
Try to understand this: #include <iostream> using namespace std; int main() { //your code goes here int waitingpassangers; cin >> waitingpassangers; int buscapacity = 50; int peopleinthelastbus = waitingpassangers % buscapacity; int emptyseats = 50 - peopleinthelastbus; cout << emptyseats; return 0; }
27th Jul 2021, 5:34 PM
Falling Never
Falling Never - avatar
0
This was my answer. Remember to add the ‘cin’ so that the run tests can input their values. It took me several tries but this runs! #include <iostream> using namespace std; int main() { int station; cin >> station; int emptyBus = 50; int lastBus = station%=50; cout << (50-lastBus); return 0; }
30th Jun 2022, 4:38 PM
Cyclonic psycho
Cyclonic psycho - avatar
0
Here is my code. #include <iostream> using namespace std; int main() { //your code goes here int passengers; cin >> passengers ; int seat = passengers % 50; if(passengers >= 50) { if(seat > 50) { cout << seat << endl; } } if(seat < 50) { cout << 50 - seat << endl; } return 0; }
15th Sep 2022, 1:15 PM
Dragon RB
Dragon RB - avatar