0
I'm having trouble in solving the transportation quiz. I need to write a code were the output from the code output can answer or
12 RĂ©ponses
+ 1
do not specify that x is equal to 138. just make it so that it seems like the user himself must enter this value
+ 1
Please, for better help, show us your code attempt
+ 1
you should not specify direct values for the number of passengers. leave it to the test program. it will generate and substitute the values it needs.
+ 1
and you didn't fulfill the second point from my suggestion to you
+ 1
Ohhh okay thanks a lot sir. Now I got it
+ 1
you can write to me in private messages here. and I do not teach unfortunately c++, I teach javascript, python and Ruby. Therefore, I can only suggest the solution algorithm, but not the syntax
0
Hi! you should:
1. from the total number of passengers, subtract the number of passengers who can take away full buses (the bus can accommodate 50 people). you will have a number that is obviously less than 50
2. from the total number of seats in the bus, you need to subtract the remaining number of passengers and this will be the number of available seats.
3. display the result on the screen.
0
I know how to answer it, but I'm having trouble in writing the codes, I have tried many different types of code but it can't answer the all the column at once
0
The bellow is my type of code to answer the problem
Int x = 138;
x = x % 50;
count << x << endl;
Int x = 119;
x = x % 50;
count << x << endl;
I have answered like this but the output only fill the case number 1 column with:
38
19
It didn't fill the case number 2 column..
0
#include <iostream>
using namespace std;
int main() {
//your code goes here
int x = 138;
x = x % 50;
cout << x << endl;
return 0;
}
0
Sir can I get your WhatsApp number? So that I can ask more about coding, I'm new here, and I think I still need some assistance..
0
I tried for an hour to solve that....
We don't need to give any integer, only need a constant 50.
#include<iostream>
Using namespace std;
Int main()
{
Int x, y, z;
Cin>>x;
y=x%50;
z=50-y;
Cout<<z;
return 0;
}