2. Pizza and a Movie Write a loop to a) Prompt the user to enter pizza toppings. (they may make one or multiple I entries). Provide a sentinel value to allow them to quit. b) Prompt the user for their age for the purpose of computing the cost of their movie ticket. 3 or younger = free; age 4 12 = $10; Over age 12 = $12 c) Print a message informing them of their pizza order. d) Print a message informing them of their ticket cost. Output Example ~~~~~ Welcome to Pizza and a Movie (type quit when done)? What topping would you like on your pizza anchovies What topping would you like on your pizza (type quit when done)? mushrooms What topping would you like on your pizza (type quit when done)? spinach What topping would you like on your pizza (type quit when done)? quit How old are you? 19 Your pizza toppings will be anchovies, mushrooms, spinach, Your movie ticket cost is $12

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
Please answer in python with showing the codes
### Pizza and a Movie

This educational exercise involves writing a program with a loop to gather user input and calculate costs based on age. The steps are as follows:

1. **Pizza Toppings Input:**
   - Prompt the user to enter pizza toppings. Allow multiple entries until the user chooses to quit, using a sentinel value to exit the loop.

2. **Age Input for Movie Ticket Cost:**
   - Prompt the user to enter their age to compute the movie ticket cost:
     - Age 3 or younger: Free
     - Age 4 to 12: $10
     - Age over 12: $12

3. **Output:**
   - Print a message informing the user of their selected pizza toppings.
   - Print another message detailing the cost of their movie ticket.

#### Output Example:

```
~~~~~ Welcome to Pizza and a Movie ~~~~~
What topping would you like on your pizza (type quit when done)?
anchovies
What topping would you like on your pizza (type quit when done)?
mushrooms
What topping would you like on your pizza (type quit when done)?
spinach
What topping would you like on your pizza (type quit when done)? quit
How old are you?
19
Your pizza toppings will be anchovies, mushrooms, spinach,
Your movie ticket cost is $12
```
Transcribed Image Text:### Pizza and a Movie This educational exercise involves writing a program with a loop to gather user input and calculate costs based on age. The steps are as follows: 1. **Pizza Toppings Input:** - Prompt the user to enter pizza toppings. Allow multiple entries until the user chooses to quit, using a sentinel value to exit the loop. 2. **Age Input for Movie Ticket Cost:** - Prompt the user to enter their age to compute the movie ticket cost: - Age 3 or younger: Free - Age 4 to 12: $10 - Age over 12: $12 3. **Output:** - Print a message informing the user of their selected pizza toppings. - Print another message detailing the cost of their movie ticket. #### Output Example: ``` ~~~~~ Welcome to Pizza and a Movie ~~~~~ What topping would you like on your pizza (type quit when done)? anchovies What topping would you like on your pizza (type quit when done)? mushrooms What topping would you like on your pizza (type quit when done)? spinach What topping would you like on your pizza (type quit when done)? quit How old are you? 19 Your pizza toppings will be anchovies, mushrooms, spinach, Your movie ticket cost is $12 ```
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 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.
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