Assignment #2
Write two classes
Class RestaurantMenu that has the following members
class RestaurantMenu
{
double price[10];
string Menu[10];
int numMeals;
public:
RestaurantMenu();
void AddToMenu(string s, double d);
void DeleteFromMenu(string s);
void ShowMenu();
double FindMeal(string s);
};
The Constructor: will fill the price array with zeros and fill the Menu array with empty strings and make the numMeals equal zero.
Put the following in the object by default (Mansaf , 2.7) (Burger, 1.50) (Falafel , 0.5)
AddToMenu this function will add a new item to the menu Ex. AddToMenu(“Salad”, 0.30).
DeleteFromMenu function will delete an item from the menu by finding the Meal name and making it empty string and the price equal to zero and decrementing the numMeals. If the Meal name is not found print any message.
ShowMenu function wil print the menu (Item, Price)
FindMeal function will search the array Menu for the string s and return its price otherwise if it is not found it will return return -1
Class RestaurantOrder that has the following members
class RestaurantOrder
{
double Bill[10];
string order[10];
public:
RestaurantOrder();
~RestaurantOrder();
void AddToOrder(RestaurantMenu obj, string s);
void DeleteFromOrder(string s);
double CalculateBill();
};
The constructor: will fill the array Bill with zeros and the array order with empty strings
The Destructor will print a Good Bye
AddToOrder function will search for the string s in the Menu object (obj) to find its price and add the string and the price to the order
DeleteFromOrder function will search for the string s in the order object to delete it by making its Bill equal zero and its name equal empty string
CalculateBill function will return the summation of the Bill
Make 3 files (MenuClass.h) (OrderClass.h) (mainFile.cpp)
Write include for “MenuClass.h” in OrderClass.h file
Write inlcude for “OrderClass.h” in mainFile.cpp file
You need to make this project with full Decoration:
The Boss should make the list to add or delete items from the Menu as many as he/she wants
The Customer need to make his/her order then compute her/his Bill
Etc...
DueDate for this assignment is Monday 2 – 4 - 2012 evening