Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

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

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions