Question: In c + + , / / TODO: Define an Inventory object for the player, and an Inventory object for the store. / * TODO:

In c++,
// TODO: Define an Inventory object for the player, and an Inventory object for the store.
/* TODO: Prompt the user for their name
*======================================
* Ask the user for their name and define a string for the
* name. Store their input in the string. If they entered
* an empty string (e.g."") assign them a default name.
*/
// TODO: Use the SetGold method to give the player inventory 200 Gold.
/* TODO: Call the AddItem method
*================================
* Use the AddItem method to add each item in the
* PlayerStartingItems array to the player's inventory.
*/
// TODO: Use the SetGold method to give the store inventory 350 Gold.
/* TODO: Call the AddItem method
*================================
* Use the AddItem method to add each item in the
* StoreStartingItems array to the store's inventory.
*/
while (true)
{
int sel =0;
do
{
Console::Clear();
/* TODO: Call the ShopUtils::ShowInventories method
*=================================================
* Call the ShowInventories method located within the
* ShopUtils class and pass in the player's name,
* the player's inventory and the store's inventory.
*/
Console::SetCursorPosition(5,18);
const std::string menu = "What would you like to do?
1) Buy
2) Sell
3) Leave
_\b";
Console::Write(menu);
sel = Utility::ReadInt();
} while (!Utility::IsReadGood()||(sel <1|| sel >3));
if (3== sel)
break;
bool doBuy = false;
if (1== sel)
{
doBuy = true;
}
/* TODO: Call the ShopUtils::DoTransaction method
*=============================================
* Call the DoTransaction method locate within the
* ShopUtils class and pass it the player's name,
* the player's inventory, the store's inventory
* and the doBuy variable.
*/
}

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 Programming Questions!