Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C + + : In Dungeons and Dragons, there are a lot of methods to roll up the ability scores for characters, which are

In C++: In Dungeons and Dragons, there are a lot of methods to roll up the ability scores for characters, which are numerical measures of the physical/mental/social characteristics of a person (typically between 3-18) and measure things like their strength, dexterity, intelligence, charisma, etc. You're task is going to be to write up a code that uses the "4d6" method.
The "4d6" method involves rolling 4 six-sided dice. You then drop the lowest die roll, and add up the remainder. For example:
rolls of 1,1,4,5=10
rolls of 3,4,5,6=15
rolls of 5,5,6,6=17
Your task is to create a function that does this. We've done die-rolling in the past. You may copy and use that function in your lab, so I've included it here:
int rollDie(void){
return 1+ rand()%6;
}
You should have appropriate separation of function prototype and implementation. The user should have the option to roll again. Make it look pretty. Your program should tell the user what it is doing. Below is a good example.
This program generates ability scores for D&D characters using the 4d6 method.
Dice Rolls: 2,2,5,6
Lowest Die Dropped: 2
Ability Score =13
Would you like to roll again? Y or N:
If you play D&D and want to expand upon it, feel free to be creative!
Hint: Store the die rolls into variables. Then store the first roll into another variable called min. Then do so if-statements to see if any of the other dice are lower, and if so, replace min with the lower roll.

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

Database And Expert Systems Applications Dexa 2023 Workshops 34th International Conference Dexa 2023 Penang Malaysia August 28 30 2023 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Maqbool Khan

1st Edition

303139688X, 978-3031396885

More Books

Students also viewed these Databases questions