- 2
C++ coding project 11
I cant complete that project it is too Hard could anyone help me with it?
24 odpowiedzi
+ 3
#include <iostream>
using namespace std;
int main() {
//your code goes here
int x;
cin>>x;
cout<<50-(x%50);
return 0;
}
+ 3
#inculde <iostream>
int main()
{
int people = 100
int seats = 28
int busses = People / seats
int taken = people % seats
int open = seats - taken
std::cout << busses << endl;
std::cout << taken << endl;
std::cout << open << endl;
return 0;
}
+ 1
U first declare a variable
Then use cin to assign input
Ex:
int x;
cin >> x;
+ 1
#include <iostream>
using namespace std;
int main() {
//your code goes here
int pass = 12;
int tila = 26;
int sum = pass + tila;
cin << sum <<endl;
int a = 231;
int b = 222;
int summ = a - b;
cin << summ <<endl;
return 0;
}
+ 1
Lol i meant algebra expressions
Here are the answers
A)
Number of busses = people / seats
B)
taken = people % seats
C)
Open = seats - taken
For this project you have to do B and C in code
Keep in mind you know the mumber of seats is 50
So you just get the number of people using cin
Then implement b and c
And output c
0
First get the number of people
Then calculate people on the last bus
Then use that to find the number of empty seats
0
Theres 5 tests how i Do all of them In one go
0
By not hardcoding the numbers but getting them using cin
0
How do i use cin?
0
Oooooh
0
Thanks for info
0
np
0
But i will dont knwo how to do this :D
0
Share what you have so far
0
Thats not my real code i guess it must have for gotten to save
0
Um start by deleting everything inside the main function lol
0
In your own words tell me the problem of the project
0
I just dont know how to solve it its Hard and i get error and dont get it working and My brain cells are dying up
0
Test case 1 input 12 expected out put 38
TEST CASE 2 input 231 expected 19
0
Dont worry about the test cases or the code
First solve this
Given that a bus contains s seats
A) write an expression to find how many busses i need to transport p people
B) write an expression to find the number of taken seats on the last bus
C ) write an exression to find the number of open seats on the last bus