Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The Class Restaurant represents some kind of eating establishment. The instances

ID: 3771502 • Letter: T

Question

The Class Restaurant represents some kind of eating establishment.
The instances McDonalds and Starbucks were created by saying:

Restaurant McDonalds( "McDonalds", 100, "1200 Pico Boulevard" );
// a McDonalds that seats 100 and located at 1200 Pico Boulevard
Restaurant Starbucks( "Starbucks", 20, "555 Santa Monica Boulevard" );
// a Starbucks seats 20 and located at 555 Santa Monica Boulevard

Each Restaurant is defined by its name, seating capacity and location. For the constructors shown above, here is the class definition (.h)

Restaurant ();
Restaurant ( string name, int capacity, string location );
int getCapacity() const;
string getLocation() const;
string getName() const;

string my_Location; // the street address
int my_Capacity; // the seating capacity
string my_Name; // the name


Based on the information shown here, a possible implementation (.cpp) for Restaurant is shown below.

my_Location = "";
my_Capacity = 0;
my_Name = "";

my_Location = location;
my_Capacity = capacity;
my_Name = name;

return my_Location;

return my_Capacity;

return my_Name;

// By default, a restaurant named "Baja Fresh" that seats 55 located at "2750 Olympic Boulevard"
MexicanRestaurant bajafresh;
// A restaurant named "Alcapulco" that seats 120 located at "45 Ocean Park"
MexicanRestaurant alcapulco( 120, "Alcapulco", "45 Ocean Park" );


TO RECEIVE FULL CREDIT, YOUR MEXICANRESTAURANT CONSTRUCTOR MUST CALL THE PARENT-CLASS RESTAURANT CONSTRUCTOR.

Class Diagram Class Definition (.h file) Restaurant Restaurant ();
Restaurant ( string name, int capacity, string location );
int getCapacity() const;
string getLocation() const;
string getName() const; std::string my_Location, my_Name;
int my_Capacity class Restaurant {
public:

Restaurant ();
Restaurant ( string name, int capacity, string location );
int getCapacity() const;
string getLocation() const;
string getName() const;

private:

string my_Location; // the street address
int my_Capacity; // the seating capacity
string my_Name; // the name

};

Explanation / Answer

working c++ for mexican class.

class MexicanResturant extends Resturant
{
MexicanResturant::MexicanResturant() {

my_Location = "2750 Olympic Boulevard";
my_Capacity = 55;
my_Name = "bajafresh";
}
   MexicanResturant::MexicanResturant( string name,int capacity,string location )
   {

my_Location = location;
my_Capacity = capacity;
my_Name = name;
}
}

//.cpp file

#include<iostream>
#include<MexicanResturant.h>
int main()
{
   MexicanResturant m1;
   MexicanResturant alcapulco( 120, "Alcapulco", "45 Ocean Park" );
   return 0;
}