0% found this document useful (0 votes)
13 views9 pages

OOP Project

Uploaded by

ahmed.tariiq20
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)
13 views9 pages

OOP Project

Uploaded by

ahmed.tariiq20
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/ 9

Project Design Proposal OOP

1. Application Concept

● Title: CafeApp
● Description: CafeApp is an intuitive cafe ordering application that allows users to
browse a virtual menu, customise their orders, and manage a shopping cart before
checking out. Designed to replicate the convenience of in-cafe ordering, it provides a
seamless and enjoyable user experience for selecting and customising menu items.

2. Application Objective

● The application aims to simplify the ordering process for cafe customers, allowing
them to customise beverages and food items, manage their cart, and complete orders
digitally. It offers a structured and efficient way to explore menu options and handle
customizations.

3. Core Functionalities

● Menu Navigation: Users can view categories (e.g., Coffee, Tea, Snacks, Desserts)
and select items within each category.
● Customization: Each item category includes options for customization (e.g., coffee
type, milk choice, dessert flavour) for a personalised ordering experience.
● Cart Management: Users can add, remove, and adjust item quantities in their cart.
The cart dynamically updates to reflect the current order total.
● Checkout Process: Users can finalise their orders and receive an order summary with
the option to view a virtual receipt.

4. Storyboard & Application Flow

● Welcome Screen: Displays a welcome message and the application title, providing
options to start a new order or view past orders.
● Menu Screen: Shows categories like Coffee, Tea, and Snacks. Users select items
within a category to view options and customizations.
○ Example (Coffee Category):
■ Users select a coffee type, this can either be hot or iced, they then
choose the options from each respectively. For iced we have two
options: Iced Latte or Iced Caramel Macchiato and for Hot we have
cappuccino and latte.
■ Customization Screen: Enables users to specify customizations for
selected menu items (e.g., choosing tea flavours or adding toppings to
drinks).
● Cart Screen: Displays the selected items, where users can adjust quantities, remove
items, and view the total cost.
● Checkout and Receipt Generation: Users confirm their order, receive a summary,
and view a virtual receipt with an option to email it.

5. Technical Flow

1. Application Launch (CafeApp Class)


- The application starts with the CafeApp class, which shows a welcome screen created
using SFML.
- The welcome screen displays a message greeting the user and inviting them to explore the
menu.presented with SFML text and graphics.

- From this screen, the user can proceed to the main menu.

2. Navigating the Menu (Menu Class)


- In the main menu, the Menu class presents different item categories, like Coffee, Tea,
Snacks, and Desserts.
- The category list:
- Type: Array of Category objects.
- Properties:
- name (String): The category name, like "Coffee" or "Snacks."
- items (Array of MenuItems): Each category contains a list of items.
- Methods:
- addItem(item: MenuItem): Adds a new item to the category.
- getItem(itemName: String): Retrieves a specific item by name.

3. Selecting and Customizing MenuItems (MenuItem Class)


- Each MenuItem shows key information:
- name (String): The item’s name, like "Latte."
- price (Float): The item’s price.
- Users can add an item to their cart and adjust the quantity if desired.

4. Cart Management (Cart Class)


- As items are added, the Cart class manages the selected items.
- It keeps track of:
- cartItems: An array of CartItem objects representing each item.
- orderTotal: The total cost of all items in the cart.
- quantity: The quantity of each item.
- Cart functions include:
- addItem(item: MenuItem, quantity: int): Adds an item to the cart.
- updateQuantity(item: MenuItem, quantity: int): Changes the quantity of an
existing item.
- removeItem(item: MenuItem): Removes an item from the cart.
- Users can review items in their cart, make changes, and proceed to checkout.
5. Checkout Process: From Cart to Order to Receipt
- When the user checks out, the system creates an Order and generates a Receipt:
- Order:
- Records all items from the cart, calculates the total, and creates a unique
orderID.
- Provides a summary for the user to review.
- Receipt:
- After order completion, a receipt is generated with:
- orderID: A unique transaction identifier.
- date: The date of the order.
- totalAmount: The final balance.

6. Customization Options for Specific Items


- Certain items, especially beverages, have customization options:
- Size: Small, medium, or large.
- Temperature: Options for hot or cold beverages, like coffee or tea.
- Type: Different subtypes, such as espresso or cappuccino for coffee, or green or black
tea.
- Other categories, like Snacks, Food, and Dessert, also offer customization features to
allow users to personalise each item.

6. CafeApp Implementation with SFML

1. Application Launch (CafeApp Class)


○ SFML will initialise the main window and display the welcome screen.
○ The welcome screen will use SFML text and graphics to present a
welcoming message and the title of the application.
○ Buttons or clickable options, created using SFML’s shapes and interactive
features, will allow users to start a new order or view past orders.
○ SFML will handle input events to detect when the user clicks to proceed to the
main menu.
2. Navigating the Menu (Menu Class)
○ In the main menu, SFML will display item categories (e.g., Coffee, Tea,
Snacks, Desserts) as interactive buttons or images.
○ SFML’s text rendering will show each category name, and Array of Category
objects will be visually presented in an organised grid or list format.
○ Clicking on a category button (handled by SFML’s event system) will
transition the user to that category's items using SFML’s rendering and text
display.
○ SFML's draw functions will render these item categories and manage the
display refresh as users navigate through them.
3. Selecting and Customizing MenuItems (MenuItem Class)
○ Each item, when selected, will show details like the name and price, rendered
with SFML text objects.
○ SFML will manage interactive elements for adding items to the cart, including
quantity adjustment controls like plus and minus buttons, using clickable
shapes.
○ SFML can display images or icons for each menu item to enhance the visual
experience, loaded with sf::Texture and displayed using sf::Sprite.
4. Cart Management (Cart Class)
○ The cart screen will use SFML to list all items the user has added, each
represented by SFML text and shape elements.
○ SFML will dynamically update the cart view as items are added, removed, or
quantities are adjusted, using real-time rendering.
○ Interactive buttons (using SFML’s shape and event handling) will allow users
to add or remove items and update quantities, with the cart total updating in
real-time.
○ SFML’s event polling will capture user interactions, enabling smooth
adjustments within the cart before checkout.
5. Checkout Process: From Cart to Order to Receipt
○ When users are ready to check out, SFML will transition to a summary screen
that displays the order.
○ SFML text objects will present each item in the cart, its quantity, and the total
order cost, along with a button to confirm the order.
○ After order confirmation, SFML will generate a virtual receipt on-screen,
showing the orderID, date, and total amount.
○ An option to email the receipt could be added, with SFML managing the UI
button for this functionality, though actual emailing would require integration
with a backend service.
6. Customization Options for Specific Items
○ For beverages and other customizable items, SFML will handle size,
temperature, and type selections using buttons or dropdowns created with
SFML shapes and text.
○ SFML can create separate sections for each customization (e.g.,
small/medium/large size), with active selections visually highlighted (like
changing colour or adding borders).
○ For categories like Snacks, Food, and Dessert, SFML will manage unique
customization screens, allowing the user to interactively select options specific
to each item type, rendered with SFML text and buttons.

7. UML Diagram
8. ILLUSTRATIONS:
Welcome Screen
Order Screen + Add-ons
Customisation screen
The Final Cart Screen

You might also like