How can I solve the first project in C++? "Transportation" I get confused | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

How can I solve the first project in C++? "Transportation" I get confused

Please I need help

1st Jun 2021, 4:32 AM
Shiblon Montera
7 Respuestas
+ 1
1. your mistake is that you are trying to use the direct value of the number of passengers in the program - 126. you should not do this. create a variable for entering the number of passengers and use this variable in the final formula. 2. think about the logic of the program. you have set the number of passengers, obviously more than 50. this means that one bus will not be able to take them away... but you need to count the number of available seats in the last bus... this means that you need to somehow remove as many passengers from the total number of passengers as full buses of 50 people can take away. then you will have the passengers who will be taken away by the last bus. and you will need to subtract the number of the last passengers from the total capacity of the bus, the resulting number will be the answer(the number of available seats)
1st Jun 2021, 11:59 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
Post your code or go through the lessons again
1st Jun 2021, 4:52 AM
Atul [Inactive]
+ 1
Hi! Please, show us your code or describe the logic of how you would try to solve this problem
1st Jun 2021, 9:17 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Int a = 126; Int b = 50; Int c = 50; Int d = 50; Int e = 24; Int sum = a - b - c - d % e; Cout << "Sum"; Return 0; It's always wrong, even the first practice, were it says type "C++ is cool!" Even if the answer was already there it was still wrong
1st Jun 2021, 11:46 AM
Shiblon Montera
+ 1
The the input was always wrong... what does it mean?
1st Jun 2021, 11:48 AM
Shiblon Montera
+ 1
Ok I'll try
1st Jun 2021, 12:08 PM
Shiblon Montera
0
I get confused of what I am suppost to put... I'll type in what I coded in a minute...
1st Jun 2021, 11:41 AM
Shiblon Montera