Select Page

CS 281 Cuyamaca College C++ Program Visual Studio 2019 Exam Practice

Question Description

You’ll add these app features for this assignment:

  1. Award points to a Player instance,
  2. A Player instance takes Treasure from a Room, and
  3. A Player instance drops Treasure in a Room

Steps for Awarding Points to a Player Instance

  1. Make sure you’ve implemented all the Player class member functions. You’ll need to call these member functions to implement the feature in your app code.
  2. In the Room class constructor, initialize your Room points data member. Set the point value according to your game world plan.
  3. In your app code, create a Player instance right after you create and initialize the Room instance.
  4. For now, assume your Player is present in the one Room you’ve built so far. This means your app code should award the Room’s point value to your Player instance.
  5. Whenever you award points to your Player instance, display a message on the screen that describes how many points were awarded and why.

Steps for the Player Instance Taking Treasure from a Room

  1. Make sure you’ve implemented all the Treasure class member functions. You’ll need to call these member functions to implement the app feature.
  2. In your app code, create and initialize a Treasure instance just before you create the Player instance. Don’t forget to set the Treasure point value.
  3. When game play begins, display a message to announce the Room’s Treasure. Display the treasure name as part of the message.
  4. In your app code, declare and write this new function with these parameters: bool takeRoomTreasure(Player* pPlayer, Room* pRoom);
  5. takeRoomTreasure() should a) remove the Treasure from the Room instance’s Treasure vector, b) add the Treasure to the Player instance’s Treasure vector, and c) award the Treasure point value to the Player instance.
  6. Add the G)et command to the app’s command menu and to the command switch statement.
  7. Call takeRoomTreasure() from the case for ‘g’ (G)et command) in your app’s command switch statement.
  8. Display a message indicating the Player took the Treasure and how many Treasure points were awarded to the Player. Include the Treasure name in this message.

Steps for the Player Instance Dropping Treasure in a Room

  1. Implement Take Treasure first (above) and verify your app runs without crashing.
  2. In your app code, declare and write this new function with these parameters: bool dropRoomTreasure(Player* pPlayer, Room* pRoom);
  3. dropRoomTreasure() should a) remove the Treasure from the Player instance’s Treasure vector, b) add the Treasure to the Room instance’s Treasure vector, and c) deduct the Treasure point value from the Player instance.
  4. Call dropRoomTreasure() from a new case for ‘r’ (dR)op command) in your app’s command switch.
  5. Make sure the dR)op command appears in the app’s command menu.
  6. Display a message indicating the Player dropped the Treasure and how many Treasure points were deducted from the Player. Include the Treasure name in this message.

Do not edit the .h files

Please make sure this compiles with Visual Studio 2019.

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now