Question: Train Ticket Calculator You will be writing a program to calculate the cost of a train ticket from Menlo Park to either New York, Philadelphia
Train Ticket Calculator
You will be writing a program to calculate the cost of a train ticket from Menlo Park to either New York, Philadelphia or Boston. The cost for a one way ticket is listed below. Peak hours are 5AM-8AM (M-F) and 3PM to 7PM (M-f). You will receive a 10% discount if you purchase a round trip ticket (the cost times 2 minus the 10%). Senior Citizens will receive a 20% discount off of the total per ticket price cost. Student tickets get a 5% discount off of the total per ticket price. If you purchase in a quantity of 10 or more you receive $10.00 off of the total cost of the tickets (you may assume all tickets are same in regards to Senior, peak roundtrip etc).
City Off Peak Hours Peak Hours
New York 14.90 17.90
Philadelphia 23.85 25.85
Boston 41.60 46.60
Your Train calculator will ask the user:
Where they are going.
Round Trip or One Way
Peak or Off Peak hours.
Number of tickets.
Are they a Senior, Student.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
