Question: In C++ create a programmer-defined function roll() that returns a random integer between 1 and 6 Create a function start_gamel) that takes in a double

 In C++ create a programmer-defined function roll() that returns a random

In C++ create a programmer-defined function roll() that returns a random integer between 1 and 6 Create a function start_gamel) that takes in a double for the amount of money a user has and returns the amount of money they have after playing the game. Each game coats $1.50 to play. - Prompt the user to guess an integer between 1-6 with input validation - Display number that is rolled. - If user guesses the correct number add $2 to user money and display your guess is correct" otherwise display incorrect The user will start with $5.00. The program should keep running as long as the user has more than or equal to $1.50 in their account. Test outputs below You currently have: $5.50 Would you like to play for $1.50? (y): y Guess a positive number (1-6): 5 You rolled a: 3 Your guess was incorrect! You lose. You currently have: $4.00 Would you like to play for $1.50? (y): y Guess a positive number (1-6): 3 You rolled a: 4 Your guess was incorrect! You lose. Welcome to the dice rolling guessing game! You currently have: $2.50 You currently have: $5.00 Would you like to play for $1.50? (y): y Would you like to play for $1.50? (y): u Guess a positive number (1-6): 1 Invalid entry! You rolled a: 1 Would you like to play for $1.50? (y): y Your guess was correct! You win $2.001 Guess a positive number (1-6): 8 Invalid entry! You currently have: $3.00 Would you like to play for $1.50? (y): y Guess a positive number (1-6): 4 Guess a positive number (1-6): 3 You rolled a: 4 You rolled a: 6 Your guess was correct! You win $2.00! Your guess was incorrect! You lose

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!