ЁЯНХ

Restaurant Ordering System Python Project

Mar 4, 2025

Python Mini Project: Restaurant Ordering System

Introduction

  • Instructor: рд╕рд╛рдЧ
  • Platform: pythonanywhere.com
  • Focus on using dictionaries and conditional statements
  • Each advanced concept will be followed by a mini project to reinforce learning

Project Overview

  • Purpose: To create a simple restaurant ordering system
  • Key Components:
    • Menu with items and prices
    • User input for placing orders
    • Calculation of total cost

Menu Items

  • Items Available:
    • Pizza: тВ╣440
    • Pasta: тВ╣50
    • Burger: тВ╣10
    • Salad: тВ╣770
    • Coffee: тВ╣80

Program Workflow

  1. Welcome Message: Display a greeting message to the user.
  2. Display Menu: Show available items and their prices.
    • Use newline characters for better readability.
  3. User Order Input: Ask the user for their first order.
  4. Conditional Logic:
    • Check if the ordered item is available in the menu.
    • If available, add the item to the order and update total.
    • If not available, inform the user.
  5. Additional Orders: Ask the user if they want to add more items.
    • If yes, repeat the order input process.
    • If no, display the total amount to be paid.

Code Structure

  • Menu Definition: menu = { 'Pizza': 440, 'Pasta': 50, 'Burger': 10, 'Salad': 770, 'Coffee': 80 }
  • User Interaction:
    • Use input() to gather orders.
    • Use formatted strings to display messages.
  • Order Total Calculation:
    • Use a variable to keep track of the total price.
    • Update total whenever a new item is added.
  • Error Handling:
    • If a user inputs an unavailable item, prompt to order something else.

Final Steps

  • Display the total amount to the user.
  • Program should ideally loop until the user decides to quit.

Next Steps

  • Future Learning: Introduction to loops to allow continuous ordering until the user exits.
  • Assignment: Create a phone book application using dictionaries to practice learned concepts.

Conclusion

  • Reinforces understanding of dictionaries and conditional statements.
  • Encourages practical application through project work.
  • Feedback and experiences are encouraged in comments.