Transportation quiz | Sololearn: Learn to code for FREE!


Transportation quiz

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


4/12/2021 2:30:07 PM


3 Answers

New Answer


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; }


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.


J A M E S Just learn lessons again and see the Explanation given in problem. You will get solution. Hint :- Use Modulus Operator ( % ) to get solution