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 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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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 .pdfmldevoor
 
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 .pdfmldevoor
 
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 .pdfmldevoor
 
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 .pdfmldevoor
 
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 .pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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 .pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 
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.pdfmldevoor
 

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

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

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