0% found this document useful (0 votes)
8 views

FoodCourt_Project_Cpp

The document describes a C++ project for a Food Court Management System that includes features to view a menu, place orders, and generate bills. The code defines a structure for menu items and a class to manage the food court operations, including displaying the menu, taking orders, and printing the bill. The main function initializes the system and executes these features sequentially.
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)
8 views

FoodCourt_Project_Cpp

The document describes a C++ project for a Food Court Management System that includes features to view a menu, place orders, and generate bills. The code defines a structure for menu items and a class to manage the food court operations, including displaying the menu, taking orders, and printing the bill. The main function initializes the system and executes these features sequentially.
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/ 2

Food Court Management System - C++ Project

Features:

- View menu

- Place order

- Generate bill

C++ Code:
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
struct MenuItem {
int id; string name; float price;
};
class FoodCourt {
vector<MenuItem> menu = {
{1, "Burger", 50}, {2, "Pizza", 120},
{3, "Fries", 40}, {4, "Coke", 30}
};
vector<pair<MenuItem, int>> cart;
public:
void showMenu() {
cout << "\n--- Food Menu ---\n";
for (auto& item : menu)
cout << item.id << ". " << item.name << " - Rs." << item.price << "\n";
}
void takeOrder() {
int id, qty; char more;
do {
cout << "\nEnter item ID and quantity: "; cin >> id >> qty;
for (auto& item : menu) {
if (item.id == id) cart.push_back({item, qty});
}
cout << "Add more? (y/n): "; cin >> more;
} while (more == 'y');
}
void printBill() {
float total = 0;
cout << "\n--- Bill ---\n";
for (auto& [item, qty] : cart) {
float cost = item.price * qty;
cout << item.name << " x" << qty << " = Rs." << cost << "\n";
total += cost;
}
cout << "Total: Rs." << total << "\n";
}
};
int main() {
FoodCourt fc;
fc.showMenu();
fc.takeOrder();
fc.printBill();
return 0;
}

You might also like