Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What ways can Beacon Street Girls market to the tween girls?

Answered: 1 week ago

Question

How can you tell if the effect is significan with ANOVA?

Answered: 1 week ago