Café Ordering System
Café Ordering System
System
Team
AI - 25
• Jhanward A. Alde
• Jhoe Mario Alfe S. Bagtong
• Kristian G. Lazarte
• Cyric Jhon Sudario
• Sean Vincent Q. Naputo
• Edril A. Cuevas
2
Overview of
the System
3
. Objective
The objective of this system is to ensure
that consumers have the flexibility to
personalize their coffee orders based
on their desired selections (size, milk,
and extras). Price adjustments are
made dynamically depending on the
alterations chosen, guaranteeing
precise and clear invoicing. The system
also supports future scalability and
integration, which will ultimately help
coffee businesses grow while delivering
a better customer experience. 4
OOP
Implementation
and Code
Documentation
We implemented the 4 principles of OOP (Object-oriented Programming) to our benefit and decided to
integrate Data Abstraction.
This system demonstrates Object-Oriented Programming (OOP) principles effectively through
encapsulation, abstraction, and composition. Encapsulation is evident as each class, such as Coffee,
OrderItem, Order, and Customer, groups related data and methods together. For instance, the Coffee
class encapsulates attributes like name, base price, and image, while the OrderItem class encapsulates
the pricing logic based on size, milk type, and extra shots. Private attributes like base price in the
Coffee class ensure controlled access through methods like get price().
Abstraction is applied to hide complex implementation details from the user. Methods such as
OrderItem. get item price() abstract the calculation logic for item pricing, and Order. save to database()
abstracts the database operations, shielding the user from the intricacies of SQL queries. Similarly,
Order.print receipt() provides a clear summary of the order without exposing the underlying logic for
formatting and calculations. These abstractions simplify interaction with the system while maintaining
clarity and functionality.
While inheritance and polymorphism are not directly used, they could be seamlessly integrated to
extend the system's functionality. 6
Relevant code snippets with proper documentation and
comments Example
Comment:
The base price attribute is made private
(prefix) to restrict direct access, ensuring it
cannot be modified directly. Instead, a public
method get price() is provided to allow
controlled access to the value. This
demonstrates encapsulation, as the internal
details of Coffee are hidden from the rest of
the system, exposing only necessary
functionality.
Comment: The get_item_price() method abstracts the
complex logic of calculating an item's price based on size,
milk type, and extra shots. This shields users from the
underlying computation details, providing a simple way to
retrieve the price. This is an example of abstraction, where
only the essential information is exposed.
Data Structures
and Algorithm
8
When a user places an order, a pricing algorithm automatically
calculates the cost of each item by factoring in the adjustments for
size, milk type, and extra shots based on the predefined rules. The
total cost of the order is calculated by summing up the individual
item prices, ensuring that the bill is accurate. To save the order
details, the system uses a database-saving algorithm that stores the
customer information, the order details, and item-specific details in
separate tables.
If the user forgets to input his name while making an order the
system notifies the user using Flask’s flash function, reminding them
that they haven’t completed the action yet. Once the order is
confirmed, a receipt is automatically generated and shown to the
user with all of the order details, giving the user a clear easy-to-read
summary of their purchase.
9
10
Database Management System (DBMS)
Orders: Stores information about orders placed. id (Primary Key) customer_id (Foreign Key
Customers.id) order_type (e.g., Dine-in, Takeout) total_price (Computed total for the order)
Order_Items: Stores details of items in an order. id (Primary Key) order_id (Foreign Key
Orders.id) coffee_name (The coffee item) size (Small, Medium, Large) milk (Regular, Soy,
Almond) extra_shots (Number of additional shots) price (Computed price for the item)
Results System:
11
The menu page displays available coffee, with their names, prices, and
images.
Features:
- Coffee options with a clear layout.
- Price information for each item.
Images of each coffee type to make the menu
visually appealing
12
The order page allows users to
choose their coffee, specify
customizations (size, milk type,
extra shots), and submit their order
Features:
- A form for entering customer details and selecting order type.
Features:
- List of ordered items with detailed customization.
15
Tools used:
VSCode
phpMyAdmin
16
Thank You
17