Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago