in c++ language Implement Resturant class as follows: 1. The member variables: - Resturant id: int. - Resturant location

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

in c++ language Implement Resturant class as follows: 1. The member variables: - Resturant id: int. - Resturant location

Post by answerhappygod »

in c++ language
Implement Resturant class as follows:
1. The member variables:
- Resturant id: int.
- Resturant location: string.
- number of Customers: int. It is unknown and can vary from one
resturant to
another.
- Customers: Customer array, its size is the number of
Customers.
2. A Resturant class constructor that receives: Resturant number
and location.
You have to use this pointer.
3. A member function void SetCustomers( Customer * n, int
num_of_Customers)
which sets the Customers for the Resturant according to received
array of
Customers. Note that this function can be used to change the
Customers as well.
4. A Destructor for Resturant Class.
5. Copy constructor.
6. A member function GetTotalInvoices which returns the sum of all
Customers’
invoices in the same Resturant.
7. A function printDetails() to print the details of the
Resturant.
8. int find(string customer_name) returns the index of customer who
was in this resturant, otherwise returns -1.
Question 3:
write a main function consists of the following:
1. create an object of type Resturant called Rest1.
- Resturant id: 1
- Resturant location: Amman
- number of Customers: 3
- Customers: create an array called customers in the main and fill
it from the user.
2. Call the printDetails function for the object rest1.
3. Change the second element in the customers array.
4. Call the printDetails function for the object Rest1.
5. Create an object of type Resturant called Rest1copy, it is a
copy of the
object Rest1. Use the copy constructor.
3. Call the printDetails function for the two objects (rest1,
rest1copy).
4. Check if the Resturant has a Customer with a name like your
name. and print a proper message describing the case.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply