Question: This is a python code and no defs, returns, or break Question 2 A nonstop train runs from Thisland to Thatland with adult and child

This is a python code and no defs, returns, or break

This is a python code and no defs, returns, or break Question

Question 2 A nonstop train runs from Thisland to Thatland 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 For Car 3 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 is 19 The percentage of the revenue from adult tickets is 93.41%. The percentage of the revenue from child tickets is 6.598. Call the file containing your program train.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!