Texts: C++ program learning
In the traditional rules, Cha are randomly generated using a roll of three 6-sided dice. Write a program to simulate the process of rolling the stats for a single character.
Create the following functions to perform the operations:
1. int roll_stat() - Returns a simulated stat roll total of three 6-sided dice, which will be a value in the range 3-18.
2. void display_stats() - Outputs to the console screen all of the six stats rolled for the character.
Please be sure to include a comment with each function definition describing its usage.
An example of the program output is given below:
Let's roll stats for our character! Rolling... Your character's stats are: STR 9 DEX 11 CON 5 INT 15 WIS 8 CHA 10
Hint: A possible algorithm for this question could be:
1. Create variables for roll result and for each of the six character stats (STR, DEX, CON, INT, WIS, CHA).
2. Initialize our random seed generator.
3. For each of the six character stats:
a. Roll 3 dice and sum the results.
b. Set the appropriate character stat to the sum from (a).
4. Display the results of all six character stats.