Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define the Restaurant class's GetName() accessor that gets data member name and the GetEmployees() accessor that gets data member employees. Ex: If the input is

Define the Restaurant class's GetName() accessor that gets data member name and the GetEmployees() accessor that gets data member employees.

Ex: If the input is Mai 22, then the output is:

Restaurant: Mai's Bistro Total: 22 employees

#include #include #include using namespace std;

class Restaurant { public: void SetName(string restaurantName); void SetEmployees(int restaurantEmployees); string GetName() const; int GetEmployees() const; private: string name; int employees; };

void Restaurant::SetName(string restaurantName) { name = restaurantName + "'s Bistro"; }

void Restaurant::SetEmployees(int restaurantEmployees) { employees = restaurantEmployees; }

/* Your code goes here */

int main() { Restaurant restaurant; string inputName; int inputEmployees;

cin >> inputName; cin >> inputEmployees; restaurant.SetName(inputName); restaurant.SetEmployees(inputEmployees);

cout << "Restaurant: " << restaurant.GetName() << endl; cout << "Total: " << restaurant.GetEmployees() << " employees" << endl;

return 0; }

c++ and please please make it correct

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

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions