0% found this document useful (0 votes)
6 views8 pages

Project Report. Data Structure of Restuarent Order System in c++

The document is a project report on a Restaurant Order System developed in C++, detailing its structure, functionalities, and implementation. It addresses the inefficiencies of manual order management in restaurants by automating the process, allowing customers to view menus, place orders, and receive receipts. The report includes code snippets, testing results, advantages and limitations, future enhancements, and concludes with the educational value of the project.

Uploaded by

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

Project Report. Data Structure of Restuarent Order System in c++

The document is a project report on a Restaurant Order System developed in C++, detailing its structure, functionalities, and implementation. It addresses the inefficiencies of manual order management in restaurants by automating the process, allowing customers to view menus, place orders, and receive receipts. The report includes code snippets, testing results, advantages and limitations, future enhancements, and concludes with the educational value of the project.

Uploaded by

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

Project Report

Title:
Data Structure of restaurant order system in c++

Table of Contents:
1. Introduction
2. Problem Statement & Objectives
3. Codes
4. Tools and Technologies Used
5. Program Design and Logic
6. Data Structures Used
7. Code Explanation (Module-wise)
8. Testing and Output Screenshots
9. Advantages and Limitations
10. Future Enhancements
11. Conclusion
1. Introduction:
The Restaurant Order System is a console-based application developed in C++
that simulates the core functionalities of a food ordering system in a small
restaurant. The aim of this project is to demonstrate basic and intermediate
programming concepts using real-world scenarios. This includes working with
user-defined data structures, arrays, control flow statements, string
manipulation, and object-oriented programming through classes. The system
allows customers to view a menu, select food items, specify quantities, and
receive a detailed receipt at the end of the transaction.

Fig: view of the ordering screen

2. Problem Statement & Objectives:


In a typical restaurant setting, managing manual orders can be inefficient,
especially during peak hours. The primary problem addressed by this system is
the lack of automation in small restaurant operations. The key objectives of this
project are:

 To implement a basic yet functional restaurant order system.


 To use appropriate data structures for menu representation.
 To allow customers to interact with the system via console input.
 To generate an accurate bill based on customer selections.
 To reduce the possibility of manual errors in taking and processing
orders.
Codes:

#include <iostream>
#include <string>
#include <iomanip>
using namespace std;

struct FoodItem {
string name;
double price;
int quantity;
};
class Restaurant {
public:
FoodItem menu[5] = {
{"Burger", 5.99, 10}, {"Pizza", 8.99, 5}, {"Pasta", 7.49, 8},
{"Salad", 4.99, 20}, {"Soda", 1.99, 50}
};
void viewMenu() {
cout << "\nMenu:\n";
for (int i = 0; i < 5; ++i)
cout << menu[i].name << " - $" << menu[i].price << " (" << menu[i].quantity << "
available)\n";
}
void takeOrder() {
string name;
cout << "\nEnter customer name: ";
cin.ignore();
getline(cin, name);
double total = 0;
while (true) {
int choice, qty;
cout << "\nChoose item (1-5) or 0 to finish: ";
cin >> choice;
if (choice == 0) break;
if (choice < 1 || choice > 5) {
cout << "Invalid item, try again.\n";
continue;
}
cout << "Enter quantity: ";
cin >> qty;
if (menu[choice - 1].quantity < qty) {
cout << "Not enough stock.\n";
continue;
}
menu[choice - 1].quantity -= qty;
total += menu[choice - 1].price * qty;
}
cout << "\nReceipt for " << name << "\nTotal: $" << fixed << setprecision(2) << total
<< endl;
}
};
int main() {
Restaurant restaurant;
while (true) {
cout << "\n***********\n";
cout << " Restaurant Order System\n";
cout << "***********\n";
cout << "1. View Menu\n";
cout << "2. Take Order\n";
cout << "3. Exit\n";
cout << "Please enter your choice (1-3): ";
int choice;
cin >> choice;
if (choice == 1) restaurant.viewMenu();
else if (choice == 2) restaurant.takeOrder();
else if (choice == 3) break;
else cout << "Invalid choice. Try again.\n";
}
return 0;
}

4. Tools and Technologies Used:


 Programming Language: C++
 Compiler: GCC / G++ (or any IDE supporting C++)
 Libraries:
o <iostream> for input/output handling
o <string> for handling textual data
o <iomanip> for formatting the receipt output
 Development Environment: Code::Blocks / Visual Studio / Dev C++

5. Program Design and Logic:


The design of the program is structured around a class called Restaurant
which encapsulates the menu and the order-handling functions. The flow of the
program is as follows:

1. Display a welcome message and options menu.


2. Allow the user to view the list of available food items.
3. If the user chooses to place an order:
o Prompt for the customer’s name.
o Allow the selection of multiple food items.
o Validate input and stock availability.
o Calculate the total bill.
o Print the receipt with a detailed breakdown.
4. Provide an exit option.
6. Data Structures Used:
The following data structures are utilized in the implementation:

 Structure (struct): A FoodItem structure is defined to store item


name, price, and available quantity.

struct FoodItem {
string name;
double price;
int quantity;
};

 Array: An array of FoodItem structures is used to store the fixed-size


menu of five items. This simplifies indexed access and iteration.
 Strings: Used for both the customer’s name and food item names.
getline() is used to capture full names.
 Class (Restaurant): Encapsulates the menu and the core functions:
viewMenu() and takeOrder().
 Primitive types (int, double): Used for quantities, loop counters, and
calculating totals.

7. Code Explanation (Module-wise):

 Menu Display (viewMenu):


o Iterates through the menu[] array.
o Displays each item with its price and available quantity.
 Order Processing (takeOrder):
o Gets customer name using getline.
o Loop for item selection until user enters 0.
o Validates input range and stock.
o Updates item quantity if enough stock is available.
o Calculates total price and formats output.
 Main Function:
o Provides the user with a menu to select options (View Menu, Take
Order, Exit).
o Executes the corresponding function based on input.

8. Testing and Output Screenshots:


Test Case 1: Valid Order
 Input: Burger x2, Soda x1
 Output:

Receipt for Anwar ul haq


Total: Rs.500
Test Case 2: Invalid Menu Choice

 Input: 7 (Invalid)
 Output:

Invalid item, try again.

Test Case 3: Stock Limit Exceeded

 Input: Pizza x10 (Only 5 available)


 Output:

Not enough stock.

Test Case 4: Empty Order

 Input: 0
 Output:

Receipt for Anwar ul haq


Total: Rs.0.00

9. Advantages and Limitations:

Advantages:

 Simple and user-friendly interface.


 Demonstrates modular and clean OOP structure.
 Avoids manual errors through input validation.

Limitations:

 Menu is hardcoded and cannot be changed at runtime.


 No persistent data storage (orders are not saved).
 Cannot handle multiple customers or concurrent sessions.

10. Future Enhancements:

 Dynamic Menu Management: Load menu items from a file or database.


 Order History Storage: Save receipts to a file for record keeping.
 Multiple Customers Queue: Handle multiple customers using advanced
structures.
 Discounts and Promotions: Add features for sales, coupons, and loyalty
points.
 GUI Interface: Create a graphical interface using libraries like Qt.
11. Conclusion:
The Restaurant Order System is a practical and educational implementation of
core programming concepts in C++. It integrates key data structures such as
structures, arrays, and classes, while offering real-world functionality. The
modular design improves readability and scalability, making it a solid
foundation for more complex systems. Through this assignment, the importance
of clean code, structured programming, and user interaction has been effectively
demonstrated.
WAH ENGINEERING COLLEGE
UNIVERSITY OF WAH

CS-201L
Data Structure and Algorithms
Project Report

Submitted to:
Sir. Saad Saud Ali Shah
Submitted By:
Anwar ul haq UW-23T-EE-BSc-009
Adeel Baig UW-24T-EE-BSc-001

Date of submission:
June, 17, 2025

Department of Electrical Engineering


Wah engineering college, (wah Cantt).

You might also like