Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve part 1 and 2 words game as described below. This assignment is to be submitted in two parts. Part 1: Problem analysis Identify all

Solve  part 1 and 2 


image

words game as described below. This assignment is to be submitted in two parts. Part 1: Problem analysis Identify all variables needed by the program . Provide a step by step algorithm for the program There is no Java code required for this part of the assignment Submit a Word document . . Part 2: Program Solution . Code a complete Java program that aligns with the analysis you did in part 1 and that conforms to the program specifications provided below Submit a java file containing your complete program code Your identifiers must use the same naming convention as the Programming Labs Dice Game Specifications: This is a simple betting game where the player tries to predict the outcome of two six-sided dice being rolled. . . . The player starts the game with $100. In each round of the game, the player is asked to place a bet greater than $0 and less than or equal to the amount of money they have, and to predict the number that will be rolled (2-12). Since the odds of predicting correctly are low, the player's bet is multiplied according to the following chart: Dice Roll Predicted 2 or 12 3 or 11 4 or 10 5 or 9 6 or 8 7 English (United States) Paragraph Multiplier 50:1 ($10 pays $500) 45:1 ($10 bet pays $450) 40:1 ($10 bet pays $400) 35:1 ($10 bet pays $350) 30:1 ($10 bet pays $300) 25:1 ($10 bet pays $250) Accessibility: Unavailable 44 E 2.1.1.1. Styles 12 13 14 15 16 17 18 19 10 11 12 13 14 15 16 At the end of the round, the player is told if they win or lose, and their total money is updated accordingly If they still have money, the player is then asked if they want to play again The game start another round if the player still has money and says 'yes' to playing again The game ends when the player says 'no' to playing again or when they run out of money Sample Execution 1: . . . You have $100. How much do you bet this round? 200 You have $100. How much do you bet this round? -5 You have $100. How much do you bet this round? 50 You bet $50. What is your prediction for the dice roll? 1 You bet $50. What is your prediction for the dice roll? 15 You bet $50. What is your prediction for the dice roll? 8 Payout is 30:1 Dice 1 comes up 6. Dice 2 comes up 1 Total toll is 7 You lose $50 You now have $50 Do you want to keep playing (y/n)? y You have $50. How much do you bet this round? 50 You bet $50. What is your prediction for the dice roll? 7 Payout is 25:1 Dice 1 comes up 5. Dice 2 comes up 1 Total roll is 6 You lose $50 You now have $0 You are now out of money. Sample Execution 2: Better luck next time! You have $100. How much do you bet this round? 30 You bet $30. What is your prediction for the dice roll? 7 Payout is 25:1 Dice 1 comes up 5. Dice 2 comes up 2 Total roll is 7 You Win $750! You now have $850 Do you want to keep playing (y/n)? y You have $850. How much do you bet this round? 100 You bet $100. What is your prediction for the dice roll? 5 Payout is 35:1 Dice 1 comes up 2. Dice 2 comes up 4 Total roll is 6 You lose $100 You now have $750 Do you want to keep playing (y/n)? n You leave with $750. Hope you play again! E E 118 119 Editing

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here are the solutions for parts 1 and 2 of the assignment Part 1 Problem Analysis Identify the variables needed by the program playerMoney This variable will store the amount of money the player has ... 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

Applied Regression Analysis And Other Multivariable Methods

Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg

5th Edition

1285051084, 978-1285963754, 128596375X, 978-1285051086

More Books

Students also viewed these Programming questions

Question

=+6 Both cats and dogs are to be tested. Should you block? Explain.

Answered: 1 week ago

Question

Using (1) or (2), find L(f) if f(t) if equals: t cos 4t

Answered: 1 week ago