.......For full points comment the code and follow all the nstructions. Write a
ID: 3534885 • Letter: #
Question
.......For full points comment the code and follow all the nstructions.
Write a craps game that will allow a user (player) to play the game of craps with the computer. How you construct the game is up to you. but be sure to use good structure with an appropriate class you create and use correctly. Create a nice opening screen that welcomes the player to your casino. Give the player a fixed starting amount of money that is set with a constant. Set this to $500 when the user first begins playing. Invite the user to place his or her bet in an integer amount. Do not allow the player to bet more than he or she has remaining. Do not allow the player to bet a negative amount. If a player who still has money bets $0. encourage him or her to try again. If a player bets $0 a second time, exit the game and make a closing statement. This should be the only graceful exit to the game--you do not want to make it too easy to stop playing! In each turn, as you have the computer roll the dice, communicate the results of each dice roll to the player. This should include the value of "the point" itself when it occurs as well as all of the dice rolls. Note that one turn may require as few as one or possibly very many dice rolls depending upon what is rolled each time. You might use the random number generator and a switch statement to print out appropriate random statements when the player wins the turn. Examples of one such phase might be. "Way to go! Why don't you bet more next time ?" Include at least 5 different statements. You might use the random number generator and a switch statement to print out appropriate random statements when the player loses the turn. Examples of one such phase might be. "Bad luck..." Include at least 5 different statements. Print out the remaining amount of money the play has at the end of each turn. Then allow the user to take another turn by placing another bet if he or she still has money remaining. If the player ever runs out of money, stop the game and make a closing statement that thanks the player for playing. Feel free to show spunk in your interactions with the player. Put comments through the code to make it clearExplanation / Answer
Here you go.
Complete running code at my terminal. You can download it from here.
http://pastie.org/private/wmzgkc3cwmxoztf2dp2ptg
feel free to contact me if you have any doubt's
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.