SlideShare a Scribd company logo
1 of 2
Download to read offline
The SetName() mutator sets data member name to restaurantName, followed by "'s Buffet", and
the SetEmployees() mutator sets data member employees to restaurantEmployees. In main(), call
SetName() and SetEmployees(), passing arguments inputName and inputEmployees,
respectively. Ex: If the input is Kai 29, then the output is: Restaurant: Kai's Buffet has 29
employees
CODE:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
class Restaurant {
public:
void SetName(string restaurantName);
void SetEmployees(int restaurantEmployees);
string GetName() const;
int GetEmployees() const;
void Print() const;
private:
string name;
int employees;
};
void Restaurant::SetName(string restaurantName) {
name = restaurantName + "'s Buffet";
}
void Restaurant::SetEmployees(int restaurantEmployees) {
employees = restaurantEmployees;
}
string Restaurant::GetName() const {
return name;
}
int Restaurant::GetEmployees() const {
return employees;
}
int main() {
Restaurant restaurant;
string inputName;
int inputEmployees;
cin >> inputName;
cin >> inputEmployees;
/* Your code goes here */
cout << "Restaurant: " << restaurant.GetName();
cout << " has " << restaurant.GetEmployees() << " employees" << endl;
return 0;
}
In C++ Please

More Related Content

More from mldevoor

The total value of all outstanding federal government securi.pdf
The total value of all outstanding federal government securi.pdfThe total value of all outstanding federal government securi.pdf
The total value of all outstanding federal government securi.pdf
mldevoor
 
The top management of an Information Technology company has .pdf
The top management of an Information Technology company has .pdfThe top management of an Information Technology company has .pdf
The top management of an Information Technology company has .pdf
mldevoor
 

More from mldevoor (20)

The traditional rule that intentional trespass was actionabl.pdf
The traditional rule that intentional trespass was actionabl.pdfThe traditional rule that intentional trespass was actionabl.pdf
The traditional rule that intentional trespass was actionabl.pdf
 
The two papers below are about Endogenous growth Theory Bas.pdf
The two papers below are about Endogenous growth Theory Bas.pdfThe two papers below are about Endogenous growth Theory Bas.pdf
The two papers below are about Endogenous growth Theory Bas.pdf
 
The United States Department of Agricultures Child and Adul.pdf
The United States Department of Agricultures Child and Adul.pdfThe United States Department of Agricultures Child and Adul.pdf
The United States Department of Agricultures Child and Adul.pdf
 
The tumor suppressor gene p53 is the most frequently mutated.pdf
The tumor suppressor gene p53 is the most frequently mutated.pdfThe tumor suppressor gene p53 is the most frequently mutated.pdf
The tumor suppressor gene p53 is the most frequently mutated.pdf
 
The trophozoite stage of Entamoeba histolytica is the active.pdf
The trophozoite stage of Entamoeba histolytica is the active.pdfThe trophozoite stage of Entamoeba histolytica is the active.pdf
The trophozoite stage of Entamoeba histolytica is the active.pdf
 
The total numbers of animal and plant species in a certain c.pdf
The total numbers of animal and plant species in a certain c.pdfThe total numbers of animal and plant species in a certain c.pdf
The total numbers of animal and plant species in a certain c.pdf
 
The transmission time X in seconds of messages in a commun.pdf
The transmission time X in seconds of messages in a commun.pdfThe transmission time X in seconds of messages in a commun.pdf
The transmission time X in seconds of messages in a commun.pdf
 
The total value of all outstanding federal government securi.pdf
The total value of all outstanding federal government securi.pdfThe total value of all outstanding federal government securi.pdf
The total value of all outstanding federal government securi.pdf
 
The Tragedy of the Commons Can we solve the situation o.pdf
The Tragedy of the Commons     Can we solve the situation o.pdfThe Tragedy of the Commons     Can we solve the situation o.pdf
The Tragedy of the Commons Can we solve the situation o.pdf
 
The toliowine information is related to Blosyon Compary for .pdf
The toliowine information is related to Blosyon Compary for .pdfThe toliowine information is related to Blosyon Compary for .pdf
The toliowine information is related to Blosyon Compary for .pdf
 
The top management of an Information Technology company has .pdf
The top management of an Information Technology company has .pdfThe top management of an Information Technology company has .pdf
The top management of an Information Technology company has .pdf
 
The tort of disparagement Question 8 options requires .pdf
The tort of disparagement Question 8 options     requires .pdfThe tort of disparagement Question 8 options     requires .pdf
The tort of disparagement Question 8 options requires .pdf
 
The Tissue Level of Organization 6a Summarizedescribe the .pdf
The Tissue Level of Organization 6a Summarizedescribe the .pdfThe Tissue Level of Organization 6a Summarizedescribe the .pdf
The Tissue Level of Organization 6a Summarizedescribe the .pdf
 
The time that lapses between placing an order and receiving .pdf
The time that lapses between placing an order and receiving .pdfThe time that lapses between placing an order and receiving .pdf
The time that lapses between placing an order and receiving .pdf
 
The spines on these plants are modified leaves Cacti also e.pdf
The spines on these plants are modified leaves Cacti also e.pdfThe spines on these plants are modified leaves Cacti also e.pdf
The spines on these plants are modified leaves Cacti also e.pdf
 
The Swiss Cheese Model A arises from the notion.pdf
The Swiss Cheese Model         A  arises from the notion.pdfThe Swiss Cheese Model         A  arises from the notion.pdf
The Swiss Cheese Model A arises from the notion.pdf
 
The systematic risk principal says that The expected return .pdf
The systematic risk principal says that The expected return .pdfThe systematic risk principal says that The expected return .pdf
The systematic risk principal says that The expected return .pdf
 
The table below contains a certain social media companys pe.pdf
The table below contains a certain social media companys pe.pdfThe table below contains a certain social media companys pe.pdf
The table below contains a certain social media companys pe.pdf
 
The StefanBoltzmann Law states that a stars luminosity te.pdf
The StefanBoltzmann Law states that a stars luminosity te.pdfThe StefanBoltzmann Law states that a stars luminosity te.pdf
The StefanBoltzmann Law states that a stars luminosity te.pdf
 
The spreadsheet lists the components of aggregate planned ex.pdf
The spreadsheet lists the components of aggregate planned ex.pdfThe spreadsheet lists the components of aggregate planned ex.pdf
The spreadsheet lists the components of aggregate planned ex.pdf
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

The SetName mutator sets data member name to restaurantNam.pdf

  • 1. The SetName() mutator sets data member name to restaurantName, followed by "'s Buffet", and the SetEmployees() mutator sets data member employees to restaurantEmployees. In main(), call SetName() and SetEmployees(), passing arguments inputName and inputEmployees, respectively. Ex: If the input is Kai 29, then the output is: Restaurant: Kai's Buffet has 29 employees CODE: #include <iostream> #include <string> #include <iomanip> using namespace std; class Restaurant { public: void SetName(string restaurantName); void SetEmployees(int restaurantEmployees); string GetName() const; int GetEmployees() const; void Print() const; private: string name; int employees; }; void Restaurant::SetName(string restaurantName) { name = restaurantName + "'s Buffet"; } void Restaurant::SetEmployees(int restaurantEmployees) { employees = restaurantEmployees; } string Restaurant::GetName() const { return name; } int Restaurant::GetEmployees() const { return employees; } int main() { Restaurant restaurant; string inputName; int inputEmployees; cin >> inputName; cin >> inputEmployees; /* Your code goes here */
  • 2. cout << "Restaurant: " << restaurant.GetName(); cout << " has " << restaurant.GetEmployees() << " employees" << endl; return 0; } In C++ Please