Order Management System
Order Management System
Overview
The Order Management System is a basic C++ console application that lets users
select meals from a menu, see the specifics of their orders, and figure out the total cost.
Features
1. Menu Display:
- The application shows a menu with selections for various meal orders.
- The price, description, and unique code are all included with each menu
item.
2. Order Selection:
- Users can choose an order by entering the corresponding number.
- The program validates user input and handles invalid selections gracefully.
3. Order Details:
- After selecting an order, the program displays the chosen order's code,
price, and description.
- Descriptions are hidden when choosing an order and revealed after the
order is made.
4. Order Tracking:
- The program tracks selected orders and their prices using vectors.
6. User Interaction:
- The program continuously prompts the user for orders until they choose to
stop.
Data Structures
1. Display menu options and prompt the user to choose an order until they decide
to stop (entering 0).
2. For each valid order selection:
- Add the selected order's code and price to the tracking vectors.
- Display the chosen order's details, including the description.
How to Use
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
// Initialize vectors to store menu information
vector<string> orders;
vector<double> prices;
vector<string> descriptions;
orders.push_back("C2");
prices.push_back(139.00);
descriptions.push_back("Chicken, Spaghetti and Drinks");
orders.push_back("C3");
prices.push_back(189.00);
descriptions.push_back("2 Pcs Chicken, Rice and Drinks");
orders.push_back("C4");
prices.push_back(209.00);
descriptions.push_back("2 Pcs Chicken, Rice, Fries and Drinks");
vector<string> selectedOrders;
vector<double> selectedPrices;
int option;
do
{
// Display menu options
for (int i = 0; i < orders.size(); i++)
{
cout << i + 1 << ". " << orders[i] << "\n";
}
// Take user input for order choice
cout << "Enter the number corresponding to your choice (0 to stop): ";
cin >> option;
cout << "Total Price: Php " << totalPrice << "\n";
cout << "Ordering stopped. Thank you!\n";
return 0;
}