Apply your knowledge to build something amazing!
:information_source: Project Overview Difficulty Level: Beginner
Estimated Time: 3-4 hours
Skills Practiced:
┌─────────────────────┐
│ Phase 1: Setup │
│ • Create menu lists│
│ • Display welcome │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ Phase 2: Take Order │
│ • Get user input │
│ • Start order loop │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│Phase 3: Process Order│
│ • Validate choices │
│ • Update quantities│
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ Phase 4: Summarize │
│ • Show order recap │
│ • Calculate total │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ Bonus Features │
│ • Add tax/charges │
│ • Promo codes │
└─────────────────────┘
In this project, you will create a simple Ice Cream Shop program that allows customers to interact with the system by selecting ice cream flavors, adding toppings, and calculating the total price of their order. The project will focus on strengthening your understanding of basic programming concepts such as print statements, user input, lists, conditional statements, and loops. You'll be encouraged to use your creativity to design the functionality and flow of the Ice Cream Shop.
This project involves coding the functionality for an interactive Ice Cream Shop system, and submitting a video demonstration. There is no report for this project.
Your project will be evaluated based on the following criteria:
Code Functionality (50%)
Code Quality (25%)
Creativity and Features (15%)
Video Submission (10%)
Final submission should include:
.py
or notebook)Make sure to double-check your project before submitting. Ensure you have included the Python code file and the video explanation as required.
:link: Submit your project here
In this project, you need to create a program for customers to order ice cream from this shop using lists, conditional statements, and loops.
:warning: Critical Setup Instructions Before you start coding:
- Click the link here
- Make a copy of the Colab Notebook to your Google Drive (File -> Save a copy in Drive)
- Rename your copy to include your name (e.g., "IceCreamShop_YourName")
- Check that you can edit and run cells in your copy
:warning: Common Error: If you can't edit the notebook, you're still viewing the original. Make sure to create your own copy!
:bulb: Milestone Checkpoint 1 By the end of Phase 1, you should have:
- :white_check_mark: Three lists containing flavor categories
- :white_check_mark: A welcome message displayed
- :white_check_mark: Menu with prices shown clearly
- :white_check_mark: Counter variables initialized
Basic = ["Vanilla", "Chocolate", "Corn"]
Fruit = ["Strawberry", "Mango", "Banana"]
Premium = ["Oreo", "Caramel", "Durian"]
:memo: Why use lists? Lists help us organize similar items together. In a real ice cream shop, you'd have different categories with different prices - just like our Basic, Fruit, and Premium lists!
Welcome to Telebort Ice Cream!
The Menu for ice cream flavours with price is as follows:
Basic(RM3): ['Vanilla', 'Chocolate', 'Corn']
Fruit(RM4): ['Strawberry', 'Mango', 'Banana']
Premium(RM5): ['Oreo', 'Caramel', 'Durian']
num_basic = 0
num_fruit = 0
num_premium = 0
:bulb: Debugging Tip If your menu doesn't display correctly, check:
- Are your list names spelled correctly?
- Did you use the correct syntax for print()?
- Are the prices clearly shown for each category?
:bulb: Milestone Checkpoint 2 By the end of Phase 2, you should have:
- :white_check_mark: Asked the customer if they want to order
- :white_check_mark: Stored their response in the
order
variable- :white_check_mark: Program ready to proceed based on their answer
order = input("\n\nDo you want to make an order? \nType 'yes' to proceed, or 'no' to stop: ")
Expected output:
Do you want to make an order?
Type 'yes' to proceed, or 'no' to stop: yes
:warning: Common Input Errors
- Problem: User types "Yes" or "YES" instead of "yes"
- Solution: Consider using
.lower()
to handle different cases- Example:
order = input("...").lower()
:bulb: Milestone Checkpoint 3 By the end of Phase 3, you should have:
- :white_check_mark: A working while loop that continues based on user input
- :white_check_mark: Conditional statements checking flavor categories
- :white_check_mark: Counters updating for each order
- :white_check_mark: A way for customers to exit the ordering process
Create a while loop, with the condition order is equal to 'yes', and keep asking the customer "Which flavor of ice cream do you want?" until the order is "no". In the while loop:
a. By using input(), ask the customer which flavor of ice cream they want and store the customer's answer in variable ans.
ans = input("\nWhich flavor of ice cream do you want? ")
b. According to the customer's answer, use conditional statements to check if the ans in the lists and reply to the customer's order (flavors may change depending on the answer)
Example:
if ans in Basic:
print("You have choose Basic flavor:", ans)
:warning: Debugging Common Errors
Error: "The choice is not available" even when typing a valid flavor
Possible causes:
- Case sensitivity (typing "vanilla" instead of "Vanilla")
- Extra spaces in input
- Misspelling the flavor name
Fix: Consider using
.strip()
and.title()
on the input
c. Update variables num_basic, num_fruit, and num_premium according to the conditions in (b).
Example:
python
if ans in Basic: print("You have choose Basic flavor:", ans) num_basic = num_basic + 1
:memo: Pro Tip Instead of
num_basic = num_basic + 1
, you can use the shorter form:num_basic += 1
d. Update the order value by asking the customer to add another order or stop.
python
order = input("\nDo you want to make another order? \nType 'yes' to proceed, or 'no' to stop: ")
Phase 4: Summary of orders :bar_chart:
tip Milestone Checkpoint 4 By the end of Phase 4, you should have:
- :white_check_mark: An order summary showing quantities
- :white_check_mark: Clear display of what was ordered
- :white_check_mark: Proper exit from the ordering loop
The expected output is as follows:
You have ordered
Basic: 1
Fruit: 1
Premium: 2
:memo: Best Practice Only show categories that have been ordered (where ``quantity > 0``). This makes the receipt cleaner and more professional!
:bulb: Milestone Checkpoint 5 By the end of Phase 5, you should have:
- :white_check_mark: Calculated the total price correctly
- :white_check_mark: Displayed the price in a clear format
- :white_check_mark: A complete working ice cream ordering system!
what flavour of ice cream do you want to eat?0
You have ordered
Basic: 1
Fruit: 1
Premium: 1
The total price is: 12
:warning: Price Calculation Tips Remember the prices:
- Basic: RM3 each
- Fruit: RM4 each
- Premium: RM5 each
Formula:
total = (num_basic × 3) + (num_fruit × 4) + (num_premium × 5)
There are few more features you can add-on for this program:
:bulb: Implementation Ideas Start with Level 1 extensions and work your way up. Each extension teaches you new programming concepts:
- Tax calculation -> Math operations
- Promo codes -> String comparison and dictionaries
- Toppings -> Nested data structures
:warning: Common Issues and Solutions
One. Infinite Loop
- Problem: Program keeps asking for orders forever
- Solution: Check your while loop condition and make sure
order
variable updates correctly2. Price Calculation Wrong
- Problem: Total price doesn't match expected value
- Solution: Print each component (num_basic x 3, etc.) separately to debug
3. Flavor Not Found
- Problem: Valid flavors show as "not available"
- Solution: Check spelling and capitalization in your lists
4. Program Crashes on Input
- Problem: Error when user enters unexpected input
- Solution: Add error handling with try/except blocks
Code with AI: Try using AI to help with project functions. Here are some sample prompts you can use: