Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Display a welcome message on the screen: Welcome to The Ice Creamery Reference: Learn to Program With Python 3 : A Step - by -

Display a welcome message on the screen:
Welcome to The Ice Creamery
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Print Statements.
Create a new list variable for storing seven ice cream flavors (i.e., flavorsList).
flavorsList =["Vanilla", "Chocolate", "Strawberry", "Pistachio", "Butter Pecan", "Cookie Dough", "Neapolitan"]
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists.
Change the name of one flavor in the list of flavors just created.
Hint: Use the index value for the position of the flavor in the list and assign it a new value.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd Edition, Chapter 7: Lists / Changing a Value in a List.
Use a built-in list operation to append a new flavor to the end of the list. You should now have eight flavors in the list.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Table 7-1: The Built-In List Operations.
Use a built-in list operation to sort the flavors list in alphabetical order.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Table 7-1: The Built-In List Operations.
Store the number of flavors in the list in a variable and display the number of flavors.
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Determining the Number of Elements in a List: The len Function.
Loop through each flavor in the list using a FOR loop to display the number and name for each item in the list.
Create FOR loop to process each flavor in flavorsList list.
With each iteration, display the flavor # using the index value in the flavors list and the name of the flavor.
Hint: Remember index positions in lists start with zero. To make this more customer friendly, add one to the index value before displaying it.
Reference: Refer back to your Unit 1 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Simple Math; Chapter 7: Lists / Position of an Element in a List: Index / Accessing an Element in a List / for Statements and for Loops.
Define dictionaries to hold the prices and descriptions for each cone size.
conePrices={"S":"$1.50","M":"$2.50","L":"$3.50"}
coneSizes={"S":"smallish","M":"more for me","L":"lotta lickin"}
Reference: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 11: Data Structures, Dictionary.
Prompt the user to enter a cone size (S, M, or L). Store their choice in a variable (i.e., customerSize).
OPTIONAL VALIDATION: Use an IF statement to ensure a valid value was entered. Display an error message if an invalid value was entered.
Reference: Refer back to your Unit 1 and 3 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input from the User; Chapter 5: The if Statement / Comparison Operators.
Prompt the user to enter a flavor number. Store their choice in a number variable (i.e., customerFlavor).
Hint: Placing int ahead of the input statement will store the user input as a number. You will be using this number as the index to find the flavor value from the list.
OPTIONAL VALIDATION: Use an IF statement to ensure a valid value was entered. Display an error message if an invalid value was entered.
Display the price, size description, and flavor for their choice. Use your conePrices dictionary to match the size value entered to the price. Use your coneSizes dictionary to match the size to the description of the size.
Hint: Remember that index positions in lists start with zero. To make this more customer friendly, we added one to the index value before displaying it. You will need to do the same here to display the appropriate value from the list.
Use print () to print blank lines as necessary for readability.
Reference: Refer to Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 7: Lists / Position of an Element in a List: Index / Accessing an Element in a List; Chapter 11: Data Structures, Dictionary.
EXAMPLE PROGRAM OUTPUT
Welcome to The Ice Creamery
These are the 8 flavors we are serving today at The Ice Creamery:
Flavor #: 1 Blueberry Crunch
Flavor #: 2 Butter Pecan
Flavor #: 3 Chocolate
Flavor #: 4 Cookie Dough
Flavor #: 5 Neapolitan
Flavor #: 6 Strawberry
Flavor #: 7 Vanilla
Flavor #: 8 Very Berry Strawberry
Please enter the cone size of your choosing: S, M, or L: S
Please enter your flavor number: 5
Your total is: $1.50
Your smallish sized cone of The Ice Creamery's Neapolitan will arrive shortly.
Thank you for visiting the Ice Cream Creamery

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

Step: 3

blur-text-image

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

=+12.2. Suppose that A 221, A( A) > 0, and 0 Answered: 1 week ago

Answered: 1 week ago