Programming Assignment 2 PYTHONAssignment Goals: understanding problem requirements, effective program design, logical thinking, if-elif-else, logical operators, named constants. Suppose the Great Frederick Fair wants to update its ticketing software. They need you to write a program to handle the price calculations, using the rules*: The basic price of a ticket is $40. Senior citizens (age >= 65) get a 50% discount. Children under 6 are free (100% discount). For residents of Frederick County, the basic price is $35; the same discounts still apply. So the individual ticket prices range from $0 to $40. Your program should request age and county name from the user. The age will be entered as an integer and the county name as a string. Before calculating the price, confirm that the user's age is valid – not negative and not more than 110. If it is not, give a message and do not do the price calculation. Also, the county name should not be case sensitive – for example, Frederick, frederick, and FREDERICK should all be acceptable. Your program should then calculate and print out the ticket price, using the appropriate discounts. Test your program with a variety of ages and counties to be sure you have considered all the conditions. Here are some samples. Test run # County Age 1 Frederick 12 2 Frederick 72 3 Carroll 2 4 Howard 65 5 Washington 0 6 Frederick 5 7 Montgomery 6 8 Carroll 35 9 Frederick -15 10 Frederick 44 11 Howard 122 12 Cecil 13 Your program should be written with the future in mind. The Great Frederick Fair might need to raise the basic prices or modify the discounts in the future. That means named constants, not hard-coded literals, for the discount rates, age cut-offs, and base price in the calculations. *These aren’t the real prices. The real system is much more complicated. My favorite among the real ones is the Carload Special Tuesday: $60 for everyone legally buckled in a vehicle, buses NOT included. Please add screensot for the solved program. Thanks alot.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 6E: (Conversion) a. Write a C++ program to convert meters to feet. The program should request the...
icon
Related questions
Question

Programming Assignment 2 PYTHON
Assignment Goals: understanding problem requirements, effective program design, logical thinking, if-elif-else, logical operators, named constants.

Suppose the Great Frederick Fair wants to update its ticketing software. They need you to write a program to handle the price calculations, using the rules*:

  • The basic price of a ticket is $40.

  • Senior citizens (age >= 65) get a 50% discount.

  • Children under 6 are free (100% discount).

  • For residents of Frederick County, the basic price is $35; the same discounts still apply.

    So the individual ticket prices range from $0 to $40.

    Your program should request age and county name from the user. The age will be entered as an integer and the county name as a string.

    Before calculating the price, confirm that the user's age is valid – not negative and not more than 110. If it is not, give a message and do not do the price calculation. Also, the county name should not be case sensitive – for example, Frederick, frederick, and FREDERICK should all be acceptable.

    Your program should then calculate and print out the ticket price, using the appropriate discounts.

    Test your program with a variety of ages and counties to be sure you have considered all the conditions. Here are some samples.

Test run #

County

Age

1

Frederick

12

2

Frederick

72

3

Carroll

2

4

Howard

65

5

Washington

0

6

Frederick

5

7

Montgomery

6

8

Carroll

35

9

Frederick

-15

10

Frederick

44

11

Howard

122

12

Cecil

13

Your program should be written with the future in mind. The Great Frederick Fair might need to raise the basic prices or modify the discounts in the future. That means named constants, not hard-coded literals, for the discount rates, age cut-offs, and base price in the calculations.

*These aren’t the real prices. The real system is much more complicated. My favorite among the real ones is the Carload Special Tuesday: $60 for everyone legally buckled in a vehicle, buses NOT included.

Please add screensot for the solved program.

Thanks alot.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning