|I need to make a c++ program for a train ticket system. Below I will list a basics of what I have done and what I need to do.|
I have done the basics, which includes a list of all the train stops, and also allows the user to input the departure and destination number. Also allowing the user to input number of adults, children and oaps.
But I am not sure how to calculate this and move onto the next step of the program.
I need the program to calculate the adult, child and senior (elderly) fare.
The pricing is below:
The minimum price for all passengers is 15p.
For adults per stop it is 10p/ for child per stop it is 6p/ and for senior it is minimum price.
I need to calculate the total minimum cost. Then add the number of adults, children and seniors. Then by adding the total price for the number of passengers that have been inputted into the program.
Once all the calculations have been completed, I then need to display the ticket, in a form which shows the parts below on separate lines in a ticket form.
stop no. ___ stop name ___
no adults ___ children ___ senior ___
adult fare ___ child fare ___ senior fare ___
cost adult ___ child ___ senior ___
Total no persons ___ total fares paid.___
The rest of the program I can do, but this part I can not.I only know basic c++, and it would help if only basic c++ is provided. I have used do/ while loops and for loops so far for other parts of the program. I hope you can help with this Thanks.