Craps is a popular gameplayed in casinos. write a program to play a variation of
ID: 3614995 • Letter: C
Question
Craps is a popular gameplayed in casinos. write a program to play a variation of the game,as follows:Roll two dice. Each die has six facesrepresenting values 1, 2, ...., and 6, respectively. Check the sumof the two dice. If the sum is 2, 3, or 12 (called craps), youlose; if the sum is 7 or 11 (called natural), you win; if the sumis another value (i.e., 4, 5, 6, 8, 9, or 10), a point isestablished. Continue until you roll either a 7 (you lose) or thesame point value (you win).
Explanation / Answer
please rate - thanks #include #include using namespace std; void GetRoll(int&); void CalcSum(int,int,int&); void printRoll(int,int,int); int main() {int dice,die1,die2,point=0; bool gameover=false; srand(time(0)); while(!gameover) { GetRoll(die1); GetRoll(die2); CalcSum(die1,die2,dice); printRoll(die1,die2,dice); if(point==0) {if(dice==2||dice==3||dice==12) {coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.