Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is incase it is too hard to see the top of the code: class Games { public: Games () = default; Games (const std::string
This is incase it is too hard to see the top of the code:
class Games
{
public:
Games () = default;
Games (const std::string &name, const std::string &type, const float &cost);
8 9 Given the following class: clasa Games 3 11 12 public Gartea (=default Games (const std::stringEnamo, const std::string type, conat float & costi; 14 15 77. zeturns the name of the Game std::string Games name) 12 18 return name; 20 21 // returns the type of the Same atd::string Games type() return_type; 77 returns the cost of the Game ont Gamescost() return most! private: stdirstring m_name: atdirstring *_type: float mCO3) Games *gameArray new Game (313 Write a function that accepts the pointer to the array of Games' objects on the heap and then copy the cost from each object to your own dynamically allocated array using a unique pointer (smart pointer). After loading the new array of costs, loop through the array eliminate the highest and lowest cost. Next, report the average cost of a game in a standard output statement and also return that average value back to the caller of the function. Assume SIZE is a declared global constant and smemory> was hash included as well . Make sure the program properly uses the accessors and mutators. Make sure the program does proper cleanup. You are only writing a function (method). Write the CODE HERE, beginning with the function headerStep 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