Question: #include #include #include using namespace std; class Eatery { public: void SetName ( string eateryName ) ; void SetCity ( string eateryCity ) ; void

#include
#include
#include
using namespace std;
class Eatery {
public:
void SetName(string eateryName);
void SetCity(string eateryCity);
void Print() const;
private:
string name;
string city;
};
void Eatery::Print() const {
cout << "Eatery: "<< name << endl;
cout << "City: "<< city << endl;
}
int main(){
Eatery restaurant;
string inputName;
string inputCity;
cin >> inputName;
cin >> inputCity;
restaurant.SetName(inputName);
restaurant.SetCity(inputCity);
restaurant.Print();
return 0;
}
Define the Eatery class's SetName() mutator that sets data member name to eateryName, followed by "'s Bakery", and the SetCity() mutator that sets data member city to eateryCity.
Ex: If the input is:
Jen
Denver
then the output is:
Eatery: Jen's Bakery
City: Denver

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!