Question: Given the following class that holds restaurants and their yelp scores(represented as numbers 0-100): 11 class Restaurant privato: string restaurant Name; // The name short

 Given the following class that holds restaurants and their yelp scores(represented
as numbers 0-100): 11 class Restaurant privato: string restaurant Name; // The

Given the following class that holds restaurants and their yelp scores(represented as numbers 0-100): 11 class Restaurant privato: string restaurant Name; // The name short *yelpscores; // points to array (on heap) of yolpa Scores int numyelpscores; // Number of scores W 1 Private member function to create an array of yelp Bcores. void createYelpscoresArray (int); 16 public: #2 Constructor Restaurant (std::string, int); 173 Copy constructor Restaurant (const Restaurant &); 17 Destructor Restaurant () delete 11 yelpscores; 23 26 14 The setYelpScore function bets a specific 14 yeip score's value. void aetYelpScore (short score, int index ! yelpscores Index] = sebre;) 29 Set the restaurant's name. void setRestaurant Name (std::string name) restaurant Name = name; 32 El Get the restaurant's name. std::string getrestaurant Name conas { return restaurant Name; 35 38 Get the number of test scores. int gotNumYelpScores return numYelpscores; Get a specific yelp scoze. short getYelpscore (int index) { return yolpscoreslindex]; } const 42 std::string get RestaurantName() conat { return zestaurant Name; } // Get the number of test scores. int getNum Yelpscores) { return numYelpscores;) 17 Get a specific yelp score. short getYelpScore (int index) const { return yelpscores [index];} }; Format // CODE #1 THE PRIVATE MEMBER FUNCTION, #2 CONSTRUCTOR, #3 COPY CONSTRUCTOR // reference the class above for the prototypes // CODE HERE #1 PRIVATE MEMBER FUNCTION create YelpScoresArray that // allocates the cstring array. Initialize the values with a 0 HERE // CODE HERE THE TWO CONSTRUCTORS // #2 CONSTRUCTOR HERE // #3 COPY CONSTRUCTOR HERE As fa la

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!