Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Coffee Shop Program in Python Copy 2

The document describes a Python-based coffee shop order system that allows users to select coffee types, specify cup counts, choose sizes, and decide between dine-in or take-away options. It includes features like input validation, error handling, and cost calculation based on selected options. This program is designed for beginners to learn Python programming concepts through practical application.

Uploaded by

prathaplisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Coffee Shop Program in Python Copy 2

The document describes a Python-based coffee shop order system that allows users to select coffee types, specify cup counts, choose sizes, and decide between dine-in or take-away options. It includes features like input validation, error handling, and cost calculation based on selected options. This program is designed for beginners to learn Python programming concepts through practical application.

Uploaded by

prathaplisa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Coffee Shop

Program in Python
Welcome to our Python-based coffee shop order system! This program

simulates a real-world coffee shop, allowing users to place orders and

calculate costs. It's perfect for beginners learning Python programming

concepts.

PR by Prathap Reddy
Introduction to the Coffee
Shop Program
1 Select Coffee Type
Choose from a variety of coffee options like Espresso,
Americano, Latte, and Cappuccino.

2 Specify Cup Count


Indicate how many cups of coffee you'd like to order.

3 Choose Coffee Size


Select from Medium, Large, or Extra Large sizes for your
coffee.

4 Dine-in or Take-away
Decide whether you want to enjoy your coffee in-store or
take it away.
Step 1: Coffee Selection
1 Menu Presentation 2 Input Validation
The program displays a It ensures a valid coffee
menu of coffee options for type is selected before
the user to choose from. proceeding to the next step.

3 Price Assignment
Each coffee type has a predefined base price stored in the
program.
Step 2: Number of Cups
User Input Input Validation
The program prompts the user It checks if the input is a

to enter the desired number of positive integer, ensuring a

coffee cups. valid order quantity.

Error Handling
If an invalid input is detected, the program asks the user to try again.
Step 3: Size Selection
Medium Large Extra Large
The standard size with no additional A bigger option for those needing an The largest size for serious coffee
charge. Perfect for a quick coffee fix. extra boost. Comes with a small lovers. Has the highest additional
upcharge. charge.
Step 4: Dine-in or Take-
Away
Dine-In
Enjoy your coffee in the cozy ambiance of our cafe.

Take-Away
Get your coffee to go, perfect for busy days.

Additional Charge
Take-away orders incur a small extra fee for packaging.
Calculating Total Cost
Base Price
1 Start with the price of the selected coffee type.

Quantity Multiplication
2 Multiply the base price by the number of cups ordered.

Size Adjustment
3 Add any additional charges for larger sizes.

Take-Away Fee
4 Include the take-away charge if applicable.
Code Overview
Coffee Selection Uses dictionary to store coffee
types and prices

Input Validation Implements while loops and try-


except blocks

Size Selection Utilizes if-elif statements for


different sizes

Cost Calculation Applies arithmetic operations to


compute total

You might also like