Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please answer the question who use Xcode PLEASE READ THE QUESTION BEFORE YOU POST THE ANSWER. USE C+AND DO IT IN FOURE FILES.ALSO RUN YOUR

image text in transcribed
image text in transcribed
Please answer the question who use Xcode PLEASE READ THE QUESTION BEFORE YOU POST THE ANSWER. USE C+AND DO IT IN FOURE FILES.ALSO RUN YOUR PROGRAM AND ANSWER IT PLEASE MOST OF THE ANSWER BEFORE ARE FALSE. SO PLEASE DONOT JUST COPY AND PASTE. DO IT FROM SCRATCH. THANKS. Requested files: Dice.h, Dice.cpp, DiceAndDanger.cpp, DiceAndDanger test.cpp Type of work: Individual work With this program, you will begin the practice of breaking source code into distinct modules that are You will create the framework of a game that uses dice to generate randonm decisions. This game is called DiceAndDanger.cpp Create a class (header and implmentation files) named Dice that can be used to create objects that simulate the behavior of one or more Die. This class should be able to simulate a die with an arbitrary number of sides; for example, it should be able to simulate a three sided die or a 21 sided die. This class must have at least two public methods: void rollO- which will simulate rolling a die by returning a random number between 1 and N where N represents the number of sides on the die int readO which will return the value showing on the "top" of the die. This value represents the number of "pips" on the face of the die considered to be the top. If you store the values of the faces of your die in an array, the top should be the first element. int read(int n) return the value associated with the nth side of the die Your class must have a default constructor that will create a die with 6 sides. It should also have a parameterized constructor which will take an argument that indicates the number of sides that the new die object should contain. DiceAndDanger.cpp should contain two methods responsible for limited scopes of behavior and data. rollCharacter(int attribute Array) which will use 6 rolls of an 18-sided die to determine each of the following character attributes: Strength, Constitution, Dexterity, Intelligence, Wisdom, Charisma. printCharacter(int attribute Array) which will print each of the characters attributes and the value rolled: Strength:17,Constitution: 12,Dexterity:8,Intelligence: 16,Wisdom: 11,Charisma:4 After the first set of character attributes is generated, the program should ask: "Roll another characer? (y):" If yes, the program should re-roll the character. If no the program should exit

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

More Books

Students also viewed these Databases questions

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago