❔ Please help with a simple train reservation simulator (I'm a beginner).
In this train reservation simulator it's supposed to have a maximum capacity of 40 passengers on board. Let's say 50 people wants to hop on the train, it should say 40 on board, 10 has to stay. Well it does that, but the next input (Station 2), let's say another 10 people wants to hop on, then it should say 40 on board 10 has to say, but it says 20 has to stay. So it's adding the previous 10 with the 10 on station 2.
(Sending a screenshot in the comments of how it looks in the console). If anyone can help it would be very much appreciated! My code is mostly written in Swedish but hopefully you'll understand by my comments in the code, if not let me know and I'll change everything. (I've been stuck in this problem for a few hours now).
If anyone who's a beginner as well and want's to connect in PM, feel free.
(Sending a screenshot in the comments of how it looks in the console). If anyone can help it would be very much appreciated! My code is mostly written in Swedish but hopefully you'll understand by my comments in the code, if not let me know and I'll change everything. (I've been stuck in this problem for a few hours now).
If anyone who's a beginner as well and want's to connect in PM, feel free.


