Question
Need help with part b at the end of this question C++ Given the restaurant class, implement a demo class to create 5 restaurants, are
Need help with part b at the end of this question C++
Given the restaurant class, implement a demo class to create 5 restaurants, are as follows
-
Limani Seafood Grill, 4.6, 379, $$$
-
La Famiglia Sorrento, 4.5, 175, $$
-
Mulberry House, 4.7, 301, $$
-
Outta Hand Pizza, 4.7, 96, $
-
Chez Catherine, 4.6, 118, $$$$
Modify the existing restaurant class to include the above information. In the main function, create an array of restaurants and find the restaurant with the highest rate, and least expensive.
Note: you may need to overload the restaurant. Keep the function with less than 3 lines to be inline functions.
-Checkpoints
#include
using namespace std;
class Tank
{
private:
int gallons;
public:
Tank()
{
gallons = 50;
}
Tank(int gal)
{
gallons = gal;
}
int getGallons()
{
return gallons;
}
};
int main()
{
Tank storage[3] = { 10 };
for (int index = 0; index < 3; index++)
cout << storage[index].getGallons() << endl;
return 0;
}
-----------------------
#include
using namespace std;
class Package
{
private:
int value;
public:
Package()
{
value = 7;
cout << value << endl;
}
Package(int v)
{
value = v; cout << value << endl;
}
~Package()
{
cout << value << endl;
}
};
int main()
{
Package obj1(4);
Package obj2;
Package obj3(2);
return 0;
}
-----------
B. Assume there are 6 different restaurant types
Italian, French, Greek, Chinese, Japanese, Mexico
Randomly generate an array of size 50 restaurants, and count the number of each restaurant in each category.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started