Question: C++ i. Write a void function called startMsg that prints the 5 welcome lines you see in the sample runs. This is all this function

C++
 C++ i. Write a void function called startMsg that prints the
5 welcome lines you see in the sample runs. This is all
this function should 2. Write a function called rollDice that will simulate

i. Write a void function called startMsg that prints the 5 welcome lines you see in the sample runs. This is all this function should 2. Write a function called rollDice that will simulate rolling two standard 6 sided dice The method will take in two int parameters, one for each die, but it will not return any value to where it was called You should allow this function to change the parameters that are passed in to it. Note that rolling two 6-sided dice is NOT equivalent to picking a random number from 2 through 12.This is because when you roll 2 dice, there is a much larger change of hitting some totals than others. All you need to do in this function is roll each die.NOoutput to the screen should occur from this function! 3. Write a function called checkForwin that takes in the two integer values you use for your dice and returns a true/false value based on if the user won on that roll or not. Any printouts of winning or losing should occur in main0 based on the results obtained from the return value from this function Along with these, the main0 function should: welcome the user, enter a loop that allows them to play the game. Before each bet (which you can assume will be an integer), notify the user of how much money they have. Start them with $500 (Declare the starting amount of money as a const int The user is done playing if they have no money left OR if they enter a negative bet amount to quit the game. Allow the user to place a bet- if the bet is more money than they have or if they bet 0, print an appropriate message (See sample runs below to see how your program should react in these scenarios) If the bet is valid.call the rollDice function to roll the two dice. Based on the result of the dice rolls print out the result of each die and the total value rolled (all from main0-your rollDice function should have no output to the screen). The user wins if the sum of the two dice adds up to 7.The checkForwin function should be called to determine if the user won or lost based on the result of the two dice. If the user wins they win the amount that they bet (2:1). If not, they lose their bet. Ex: if they bet 100 and win, they get their 100back plus an extra 100. If they bet 100 and lose, they lose their bet of 100. If the game exits because the user has no money left, print a "You're broke!" Message. Otherwise, inform them of how much S they are leaving with if they leave early. If they leave with less money than they started with, tell them HOW MUCH money they lost, else, tell them HOW MUCH money they made

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!