Question: python program Question 2 A nonstop train runs from Thisland to Thotland with adult and child passengers in several (N) cars. The number of passenger
python program

Question 2 A nonstop train runs from Thisland to Thotland with adult and child passengers in several (N) cars. The number of passenger cars (N) should be obtained as input. For each car print the car number (starting at car 1) and obtain, as input, the number of adult passengers and the number of child passengers in the car. Calculate and print, with appropriate labels the total number of passengers on the train. In addition, calculate and print, with appropriate labels, the percentage of the revenue from adult tickets and the percentage of the revenue from child tickets. Assume that a child's ticket costs $120.50 and an adult's ticket costs $320.00. Sample input and output for 3 passenger cars is as follows: Enter the number of passenger cars on the train: 3 For Car 1 Enter the number of adults in the car: 3 Enter the number of children in the car: 2 For Car 2 Enter the number of adults in the car: 5 Enter the number of children in the car: 1 Enter the number of adults in the car: 8 Enter the number of children in the car: 0 The total number of passengers on the train 1s 19 The percentage of the revenue from adult tickets is 93.418. The percentage of the revenue from child tickets is 6.593. For Car 3 Call the file containing your program train.py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
