الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

هل محاولتى صجيحه

بدأه سرمد الليل في 25 أكتوبر 2010 · 3 رد · 589 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

لى سوال وحاولت فيه حله وهذا السوال ومحاولتى ...

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;
}
−1
#2

حددي ما هي مشكلة الكود ؟!

سبحآن الله وبحمده .. سبحآن الله العظيم .. ,

#3

طريفه كتابه الكوبى كونتستركتر

#4
سرمد الليل كتب:

طريفه كتابه الكوبى كونتستركتر

انتى لم تضعى كود فى الكوبى كونستراكتور

بالتالى يمكنك النظر الى هذا المووضوع

فهو يشرح كيفيه عمل كوبى كونستراكتور

http://www.arabteam2...howtopic=150926

بالتوفيق

تم تعديل هذه المشاركة بواسطة Mahmoud Kelany في 26 أكتوبر 2010 في 14:40

Software Developer
Mahmoudkelany.com


 

مواضيع مشابهة