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 # 1 2 3 4 5 6789 County Frederick Frederick Carroll Howard Washington Frederick Montgomery Carroll Frederick Age 12 72 2 65 0 5 6 35 15

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
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 #
1
2
3
4
5
6
7
8
9
County
Frederick
Frederick
Carroll
Howard
Washington
Frederick
Montgomery
Carroll
Frederick
Age
12
72
2
65
0
5
6
35
-15
Transcribed Image Text: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 # 1 2 3 4 5 6 7 8 9 County Frederick Frederick Carroll Howard Washington Frederick Montgomery Carroll Frederick Age 12 72 2 65 0 5 6 35 -15
Frederick
Howard
Cecil
44
122
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.
Transcribed Image Text:Frederick Howard Cecil 44 122 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.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education