Question: Can you write down simple C++code E.3 Dice Game Using rand0 Requirements: Write a dice rolling program to roll a die to reach a total


Can you write down simple C++code
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. 1. 2. Create a function rollDice that returns an integer result of the rolled dice. The function will have the following prototype: int rol1Dice ) 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
Get step-by-step solutions from verified subject matter experts
