Question: RPG Start Screen Create a program that gathers user input to construct player character builds for a role-player game (RPG.) Console RPG Start Screen COMMAND

RPG Start Screen Create a program that gathers user input to construct player character builds for a role-player game (RPG.) Console RPG Start Screen

COMMAND MENU

show - Display all players

add - Add a player

delete - Delete a player

exit - Exit program

Command: show

1. Bob Warrior M 100

2. Samantha Mage F 200

3. John Thief M 275

Command: add

Create a Mage, Warrior, Bowman, or Thief

Name: Joel Class: Priest

Invalid class, try again

Class: Mage

Sex: M

Gold: 100

Command: show

1. Bob Warrior M 100

2. Samantha Mage F 200

3. John Thief M 275

4. Joel Mage M 100

Command: exit

Specifications

I have provided you with a tab-delimited text file named players.txt that stores the player character data. Use a structure to store the name, classification (class), sex, and amount of gold for each player.

Use an enumeration to enumerate the possible classifications for each player.

For the show command, display a numbered list of the characters, including their name, classification (class), sex, and amount of gold. Note that class is a keyword in C++ and cannot be used for the name of the classification variable.

To add a new player character, the user must enter a name thats 10 or less characters long and a class that matches one of the values of the classification enumeration.

When reading contacts from the text file, you can read all text up to the next tab by adding a tab character ('\t') as the third argument of the getline() function.

Additions and deletions of player characters should be immediately written to the text file

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