Using C++, I need help making a character-stat creator program. The program uses a pre-determined selection of races,using an enum to store them.I understand that enums can’t be directly accessed from a struct, but I think I found a workaround?
_____________________________________________________________________
#include
using namespace std;
enum characterRaces_A { Human = 1, Elf, Hobbit, Fish };
struct stuff{ characterRaces_A characterRaces; };
int main ()
blah blah
(IF THERE IS AN EASIER WAY PLEASE LET ME KNOW)
_____________________________________________________________________
Each race has a pre-determined selection of stats. The selection and pre-determined stats are below
Elves get a +3 to intelligence, +2 tocharisma, and a -1 to strength.
Hobbits get a -3 to strength, +2 to agility, and a -1 for constitution.
Fish get a +4 to agility, -2 to strength, -1 to constitution, and a -1 to charisma.
Humans get a +2 to strength and constitution.
_____________________________________________________________________
Now onto the stuff that I actually need help with.
The program has toask the user what character type they want to generate. The user will select a race, gender, and then input name (char array). The computer will roll 4 six-sided dice to generate the stats. The lowest die must be dropped. (Example: 2+4+6+5 = 15 because the 2 is dropped.) Then the pre-determined modifiers of each race above are applied. No statistic may be above 18, nor lower than 7 (even with the modifiers). The stats must be randomized and the modifiers calculated. No user may enter raw data for the stats.
_____________________________________________________________________
The program needs to have the following:
1. Enum for race.
2. A structure for all of the character variables described above. The enum must be inside the structure.
3. You must use the structure pointer operator in the program.
4. A char array for the name.
5. 2 or more functions
_____________________________________________________________________
The output should look similar to this:
Welcome to Simple Character Creator.
Please select one of the following races:
1. Hobbits.
2. Elves.
3. Human.
4. A Fish.
You Selected: Human
What gender? (M/F): M
You selected a Male Human.
What is your character’s name? John
John’s stats are:
Agility: 10
Constitution: 12 (Rolled with a -1 modifier)
Strength: 15 (Rolled a 13 with a +2 modifier)
Intelligence: 16
Charisma: 13
Would you like to roll another character (Y/N)? Y
Please select one of the following races:
1. Hobbits.
2. Elves.
3. Human.
4. A Fish.
You Selected: A Fish
What gender? (M/F): M
You selected a Male Fish.
What is your character’s name? Nemo.
Nemo’s stats are:
Agility: 14 (Rolled a 10 with a +4 modifier)
Constitution: 8 (Rolled a 9 a -1 modifier)
Strength: 10 (Rolled a 12 with a -2 modifier)
Intelligence: 15
Charisma: 14 (Rolled a 15 with a -1 modifier)
Would you like to roll another character (Y/N)? N
Goodbye.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more