Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started