- 3
11 Code Project - Question
Update: It’s a new day and I got it! :) And thanks for the help to all!! _____________ Hey! :) Maybe my question is dumb… but: Can somebody help me with “11 Code Project”? :( Thanks in advance! This was my idea… […]
36 odpowiedzi
+ 8
Jeremy
only 50 passengers can travel at the time so if total passengers are 126 then bus can take 3 round (50 * 2 + 26 * 1) so on 3rd round (50 - 26 = 24) seats will be left. Here 26 is a reminder and how you can get this, by using modulus operator (%) so here 126 % 50 = 26 now subtract this 26 from 50 to get left seats.
So here is solution:
int maxSeats = 50;
cout << maxSeats - passengers % maxSeats;
where passengers is input
+ 6
Solo
for more explanation you can click on Follow button in my profile section. 😃😃
+ 4
You must assign the user input to the WaitingPe variable.
+ 3
A͢J, ah, so that's how it works! ☺️
And then I think why I have only 800 subscribers in four years, so I'm stupid.
Thanks, now I know. Maybe I'll get myself 13 thousand as well.😃
+ 3
Manav Roy - So how does your blog make you money? ☺️
+ 2
Read the lesson and this assignment carefully. The result should be one, not three like yours.
+ 2
Think about how to write a program so that it calculates for any value, and not just when it is equal to 126
+ 2
I could give you ready-made solutions for all tasks, but the question is: "how then will you find out about your learning gaps?"
+ 2
Go back to the lesson about working with variables.
+ 2
Show me your next attempt, taking into account my remarks.
+ 2
You should not add anything from yourself like this:
cout << "Anzahl der Wartenden: \n";
When entering data, you do not need an endl statement, it should be set if necessary to output data: cin >> LeuteAnHalte;
you do not need any cycles, since you have not yet completed them, and you are given tasks to test your knowledge of the material in this section.
When outputting data, the arrows are directed from the variable: "<<".
Bug:
cout >> Bustour2 >> endl;
+ 2
What does the operator "%" do?
+ 2
I'm not asking you what the result is when you use the modulo division operator "%", I basically want to know what you know about this operator, how it works. What is the result if 126%50?
+ 2
A͢J, it's good that you are so responsive.
But at least you could explain to Jeremy how it works?
Maybe at the same time you will transfer your monthly salary to me? ☺️
Then and don't need to study 🤣
+ 2
♾️ D Shah ♾️ , only turtles? ☺️
+ 1
#include <iostream>
using namespace std;
int main() {
//your code goes here
int MaxPlaetze = 50;
int LeuteAnHalte;
cout << "Anzahl der Wartenden: \n";
cin >> LeuteAnHalte >> endl;
int Bustour1 = LeuteAnHalte - MaxPlaetze;
int Bustour2 = Bustour1 - MaxPlaetze;
cout >> Bustour2 >> endl;
return 0;
}
+ 1
Jeremy, happy for you! 👏 👏 👏
So can you now answer my last question? 😎
+ 1
Manav Roy, A͢J is not joking, he has 13.5K subscribers ☺️
We should learn from him.
You helped a lot by writing the task. You should have added a hint here from the marked block⚠️, because many people do not pay attention to it at all.☺️
+ 1
Udar