Restaurant Management System
Restaurant Management System
Reg id 241874
section 1c
Restaurant Management System
Code:
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <windows.h>
#include <conio.h>
void choice12();
void mainFunctionEMP();
string FinalMenu;
string name;
string address;
struct MenuItem {
string name;
float price;
};
cout << (i + 1) << ". " << menu[i].name << " ($" << fixed << setprecision(2) << menu[i].price << ")\n";
int choice;
vector<MenuItem> order;
while (true) {
system("cls");
displayMenu(menu);
if (choice == 0) {
system("cls");
cout << "Do you want to add more orders? Y = Yes, N = No" << endl;
cout << "Choose: ";
char lp;
choice12();
else
break;
order.push_back(menu[choice - 1]);
cout << "Added " << menu[choice - 1].name << " to your order.\n";
cout << "Current Total: $" << fixed << setprecision(2) << total << endl;
else {
system("cls");
if (order.empty()) {
return;
FinalMenu.pop_back();
cout << "Total: $" << fixed << setprecision(2) << total << endl;
if (outFile.is_open()) {
outFile << "Total Amount: $" << fixed << setprecision(2) << total << endl;
outFile.close();
else {
cout << "Unable to open file to save order details." << endl;
}
int main()
system("cls");
cout << setw(57) << "\t\t\t\t| DEVELOPED BY Abdullah, Talha and Salar |" << endl;
Sleep(2000);
system("cls");
cout << "\n\n\t\t\tWelcome to our online food delivery service!" << endl;
cout << "\t\t\tHere are some important rules to follow:" << endl;
cout << "\n\n1. Ensure that the food has proper packaging to maintain freshness." << endl;
cout << "2. Keep track of temperature control during delivery." << endl;
cout << "3. Avoid physical and chemical contamination." << endl;
cout << "4. Be aware of allergens and label them appropriately." << endl;
cout << "5. include any conditions or deadlines for requesting refunds." << endl;
cout << "6. Send order confirmation and delivery updates via SMS or
email([email protected])" << endl;
Sleep(4000);
system("cls");
char selected;
while (loop)
int choiceOfPortal;
cin.ignore();
cout << "\n\n\t\t\t\t\tPlease Select the Category:" << endl;
selected = _getch();
if (selected == '1')
while (true)
string username;
int password;
if (username == "admin") {
// Username is valid
else {
_getch();
system("cls");
}
if (password == 12345) {
cout << "Welcome, " << username << "!" << endl;
cout << "Press any key to move to the admin page: ";
_getch();
mainFunctionEMP();
break;
else {
_getch();
system("cls");
loop = false;
system("cls");
loop = false;
cout << "\n\t\t\t\t\t Your Delivery Address: " << address << endl;
system("cls");
choice12();
else
_getch();
system("cls");
}
}
void choice12()
vector<MenuItem> foodMenu = {
{"Burger", 5.99},
{"Pizza", 8.49},
{"Salad", 3.95},
{"Pasta", 6.75},
{"Sushi", 12.99},
{"Taco", 4.25},
{"Sandwich", 5.50},
{"Steak", 15.75},
{"Soup", 3.25},
{"Ramen", 9.25},
{"Burrito", 6.95},
{"Shawarma", 8.75},
{"Curry", 11.50},
{"Omelette", 5.25},
{"Waffle", 6.25},
{"Samosa", 2.99},
{"Pho", 8.25}
};
system("cls");
vector<MenuItem> drinkMenu = {
{"Mojito", 4.50},
{"Bellini", 3.99},
{"Sangria", 4.25},
{"Paloma", 3.50},
{"Mimosa", 2.95},
{"Negroni", 5.75},
{"Sidecar", 5.99},
{"Caipirinha", 4.50},
{"Hurricane", 5.25},
};
system("cls");
vector<MenuItem> coffeeMenu = {
{"Espresso", 3.0},
{"Cappuccino", 4.5},
{"Latte", 4.0},
{"Mocha", 4.25},
{"Boulevardier", 4.25},
{"Gimlet", 3.75},
{"Manhattan", 5.99},
{"Sazerac", 4.50},
};
system("cls");
vector<MenuItem> SweetsMenu = {
{"Brownie", 3.25},
{"Macaron", 1.99},
{"Lemon Tart", 3.50},
{"Churros", 3.95},
{"Tiramisu", 6.99},
system("cls");
vector<MenuItem> icecreamsMenu = {
{"Vanilla", 3.50},
{"Chocolate", 3.75},
{"Strawberry", 4.25},
{"Coffee", 3.95},
{"Pistachio", 4.50},
{"Neapolitan", 5.50},
{"Cookie Dough", 4.25},
{"Bubblegum", 3.50},
{"Tiramisu", 5.99},
system("cls");
vector<MenuItem> fishMenu = {
{"Salmon",4.3},
{"Tuna",8},
{"Cod",4.2},
{"Trout",2.3},
{"Halibut",3},
{"Sardines",5.5},
{"Mahi Mahi",6},
{"Barramundi",7.1},
{"Snapper",2.2},
{"Grouper",1.2},
{"Haddock",2.2},
{"Mackerel",3.8},
{"Catfish",5.5},
{"Sole",5.6},
{"Flounder",6.6},
{"Perch",7.7},
{"Rainbow Trout",10},
{"Anchovies",4.5},
{"Swordfish",3.3},
{"Bluefish",2.2}
};
system("cls");
int menuChoice;
while (true) {
system("cls");
switch (menuChoice) {
case 1:
placeOrder(foodMenu);
break;
case 2:
placeOrder(drinkMenu);
break;
case 3:
placeOrder(coffeeMenu);
break;
case 4:
placeOrder(SweetsMenu);
break;
case 5:
placeOrder(icecreamsMenu);
break;
case 6:
placeOrder(fishMenu);
break;
case 7:
exit(0);
default:
system("cls");
break;
}
void mainFunctionEMP() {
struct Employee {
int id;
string name;
string position;
double salary;
};
struct FoodItem {
int id;
string name;
double price;
};
vector<Employee> employees;
vector<FoodItem> foodItems;
int choice;
do {
system("cls");
if (choice == 1) {
Employee emp;
getline(cin, emp.name);
getline(cin, emp.position);
employees.push_back(emp);
if (file.is_open()) {
file << emp.id << "," << emp.name << "," << emp.position << "," << emp.salary << endl;
file.close();
else {
else if (choice == 2) {
if (employees.empty()) {
else {
cout << "ID: " << emp.id << ", Name: " << emp.name
else if (choice == 3) {
FoodItem item;
getline(cin, item.name);
foodItems.push_back(item);
ofstream file("food_items.txt", ios::app);
if (file.is_open()) {
file << item.id << "," << item.name << "," << item.price << endl;
file.close();
else {
else if (choice == 4) {
if (foodItems.empty()) {
else {
cout << "ID: " << item.id << ", Name: " << item.name
else if (choice == 5) {
else {
}
} while (choice != 5);