لى سوال وحاولت فيه حله وهذا السوال ومحاولتى ...
To reserve a table in Himalaya Fast Food restaurant you should call the restaurant phone operator, restaurant owner wants to automate this process. Note that the max number of tables is 6 and each table can serve up to 4 guests only. Develop a program with the following technical details:
Complete a program below with the following technical details:
- Use a parameterized constructor to initialize data members. (Choose appropriate data structure for tables), and use copy constructor if you need to.
- Use this pointer in get functions (You may not need set functions)
- Develop a reserveTable function to reserve a table, search until you find first available one, if all of them are full; alert message should be printed. If there is a one; ask the user to input the desired number of seats and validate it. Then, reserve the corresponding table.
- Develop a clearTable function that clear a table, ask the user to input the table number, and validate it to be in range and don’t clear already free table.
- Develop a global function TableStatus that prints the tables’ restaurant status.
- Make a menu driven main program to test all functions as followings:
1- Print max tables and number of guests
2- Reserve a table
3- Clear a table
4- Print Restaurant Status
5- Exit
محاولتى
class Restaurant
{
public:
// Constructor with default values
Restaurant(int numberOfTables = 6, int maxGuestsPerTable = 4);
Restaurant(const Restaurant &restaurantToCopy);
void reserveTable();
void clearTable();
private:
int numberOfTables;
int maxGuestsPerTable;
int *table;
};//end of class
Restaurant::Restaurant(int pNumberOfTables, int pMaxGuestsPerTable)
{
numberOfTables = pNumberOfTables;
maxGuestsPerTable = pMaxGuestsPerTable;
table = new int[numberOfTables];
}
Restaurant::Restaurant(const Restaurant &restaurantToCopy)
{
}
void Restaurant::reserveTable()
{
}
void Restaurant::clearTable()
{
}
void TableStatus(Restaurant R)
{
int main()
{
Restaurant res;
return 0;
}