You are making a ticketing system. The price of a single ticket is $100. For children…
Jump to turn (8)
- 1You are making a ticketing system. The price of a single ticket is $100. For chi
- 2You are making a ticketing system. The price of a single ticket is $100. For chi
- 3Write a program that takes an input string and outputs the 3rd character of the
- 4Given a list of numbers, output "bingo" if it contains the input number. Do not
- 5Given a list of numbers, output "bingo" if it contains the input number. Do not
- 6Fill in the blanks to iterate over the string "str" and output each character. f
- 7Which construct can be used to iterate through a list? Variable assignment if st
- 8for loops allow you to easily iterate through lists. Given a list of numbers, ca
- User
You are making a ticketing system. The price of a single ticket is $100. For children under 3 years of age, the ticket is free.
Your program needs to take the ages of 5 passengers as input and output the total price for their tickets.
Sample Input 18 24 2 5 42
Sample Output 400
There is one child under 3 among the passengers, so the total price of 5 tickets is $400.
- Assistant
To solve this problem, you can use a loop to iterate through the ages of the passengers and calculate the total price based on the given conditions.