Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write this in C++!! E.3 Dice Game Using rand0 Requirements: Write a dice rolling program to roll a die to reach a total dice

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Please write this in C++!!

E.3 Dice Game Using rand0 Requirements: Write a dice rolling program to roll a die to reach a total dice value of 25. Specifications: For this question, you will be simulating the rolling of dice. This can be accomplished by using the built in rand function discussed in lecture unit 5, slides 50 through 58. You will use this function to randomly generate a number between 1 and 6 inclusive to simulate a single roll of a die. Create a function rollDice that returns an integer result of the rolled dice. The function will have the following prototype: 1. 2. int rollDice Inside your main function, you will tell the user the goal score of the game (25) and tell them their current score (starts at 0 and gets larger the more dice they roll). Ask the user to choose if they would like to roll another die or stay at their current score. If they wish to roll, call the rollDice function and add the returned result to the user's current score. You should also display the result returned from the rollDice function in the main with a print statement. For example, 3. 4. 5. cout

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

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

Group Size and Communication

Answered: 1 week ago

Question

Understanding Group Roles

Answered: 1 week ago