Question: Using your Games class, create an array of Games objects on the heap (three for the SIZE) and then pass the pointer that points to
Using your Games class, create an array of Games objects on the heap (three for
the SIZE) and then pass the pointer that points to that array to a function that
loads it up with the same info from part A. Print the arrays values using the
pointer. Make sure the program properly uses the accessors and mutators. When
completed the program should cleanup.
//This is my Games class
class Games { private: string gameName, gameType; float gameCost; public: //constructor to initialize all three data members Games(string gName, string gType, float gCost): gameName(gName), gameType(gType), gameCost(gCost){}
//Get methods for each data members to get values of each data member string getGameName() { return gameName; } string getGameType() { return gameType; } float getGameCost() { return gameCost; }
//Set methods for each data members to change values of each data member void setGameName(string gName) { gameName = gName; } void setGameType(string gType) { gameType = gType; } void setGameCost(float gCost) { gameCost = gCost; } };
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
