Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using matlab program creat the the following: Initialize variable pointBalance to 1000 points. Prompt the player to enter a value. Use a while loop to

using matlab program creat the the following: Initialize variable pointBalance to 1000 points. Prompt the player to enter a value. Use a while loop to check that valueis less than or equal to pointBalance, and if not, prompt the user to reenter valueuntil a valid valueis entered. After a correct valueis entered, run one game of craps. If the player wins, increase pointBalance by valueand print the new pointBalance. If the player loses, decrease pointBalance by value, print the new pointBalance, check whether pointBalance has become zero, and if so print the message, "Sorry. You busted!" As the game progresses, print various messages to create some chatter such as, "Oh, you're going to lose, huh?" or "Aw cmon, take a chance!" or "You're up big!"Craps:A player rolls two dice. Each die has six faces. These faces contain 1, 2, 3, 4, 5, and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum
image text in transcribed
Initialize variable pointBalance to 1000 points. Prompt the player to enter a value. Use a while loop to check that value is less than or equal to pointBalance, and if not, prompt the user to reenter value until a valid value is entered. After a correct value is entered, run one game of craps. If the player wins, increase pointBalance by value and print the new pointBalance. If the player loses, decrease pointBalance by value, print the new pointBalance, check whether pointBalance has become zero, and if so print the message, "Sorry. You busted!" As the game progresses, print various messages to create some "chatter" such as, "Oh, you're going to lose, huh?" or "Aw cmon, take a chance!" or "You're up big!" Craps: A player rolls two dice. Each die has six faces. These faces contain 1,2,3,4,5, and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum is 2,3 , or 12 on the first throw (called "craps"), the player loses (i.e., the "house" wins). If the sum is 4,5,6,8, 9, or 10 on the first throw, then that sum becomes the player's "point." To win, you must continue rolling the dice until you "make your point." The player loses by rolling a 7 before making the point

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

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

A Y B

Answered: 1 week ago