Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve 4 and the questions under it (Q1, Q2...) That is 4. Implement the main function: Q1: Create a restaurant with parameters Q2: Create

image text in transcribedimage text in transcribedimage text in transcribed

Please solve 4 and the questions under it (Q1, Q2...) That is

4. Implement the main function:

Q1: Create a restaurant with parameters

Q2: Create a menu for that restaurant with the initial price of 2000fcfa

Q3: Create an array of n customers:

Q4: Order a menu for each customer

Q5: Prints the names of customers who have not successfully ordered the menu (that is their expenditure is greater than 0)

Q6: write the instruction that allow knowing the address of the restaurant in which a customer ate.

Also, Here is what was done for the first portion

image text in transcribed

the fcfa is a currency just like the dollar. I need this in an hour or two if possible. Please help me!! I will leave a like and excellent comment about the work. Thanks in advance.

Section B: Programming We have the following classes that allow managing a restaurant with the customers class Restaurant private: String name: String adress; public: String getName(); String getAdress(); void setName(String name); void setAdress (String adress); class Menu public: String name: Restaurant R; int price: int max_num_plates: //maximum number of plates int num_plate; /umber of plates ordered Menu (Restaurant Ri, int price) { this.R = R1; this.price - price: } void addNumberOfPlates (int n) { num_plate++; ) void add_or_reduce_price(int amount) {....()} Eclass Customer 3 public: String name : int expenditure; Customer() expenditure - 0; } void order (Menu m) .... (1) //verify .... (2) 1/change expenditure if necessary Dint main() { //01 Create a restaurant 1792 Create a menu for that restaurant with the initial price of 2000 1/93 Create an array of 3 customers 1/04 Order a menu for each customer 1/05 Prints the names of customers who have not succesfully ordered the menu /*Q6 write the instruction tha allow to know the address of the restaurant in which a customer ate. / 1. Implement the parametized constructor of the class Restaurant 2. In programming how do we call the set of 04 functions that are found in the class Restaurant? 3. Implement the copy constructor of the customer class 4. Give an implementation of (11.2) and (3) (1): verify if it is possible to order that menu by checking if the maximum number of plates is not attain, if not increment it. (2): add the expenditures if necessary (with the price of the menu) (3): implement this function 4. Implement the main function: Q1: Create a restaurant with parameters Q2: Create a menu for that restaurant with the initial price of 2000fcfa Q3: Create an array of n customers: Q4: Order a menu for each customer Q5: Prints the names of customers who have not successfully ordered the menu (that is their expenditure is greater than 0) Q6: write the instruction that allow knowing the address of the restaurant in which a customer a ate. #include using namespace std; class Restaurant { private: string name; string address; public: Restaurant() { } // 1. Parameterized Constructor of Restaurant Restaurant(string name, string address) { this->name = name; this->address = address; } string getName() { return name; } string getAddress() { return address; } void setName( string name) { this->name = name; } void setAddress( string address) { this->address = address; } }; class Menu { public: string name; Restaurant R; int price; int max_num_plate; int num_plate; Menu(Restaurant Ri, int price) { this->R = R1; this->price = price; } void addNumberOfPlates( int n) { num_plate++; } void add_or_reduce_price(int amount) { // 4.3 price += amount; } }; class Customer { public: string name; int expenditure; // 3. Copy Constructor Customer( const Customer& customer) { this->name = customer.name; this->expenditure = customer.expenditure; } Customer() { expenditure = 0; } void order(Menu &m) { // 4.1 if (m.num_plate 0) { cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions