Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 header

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

What are the tasks of a human resources specialist?

Answered: 1 week ago

Question

5. Wyeth Pharmaceuticals

Answered: 1 week ago