Solve part 1 and 2 words game as described below. This assignment is to be submitted in
Fantastic news! We've Found the answer you've been seeking!
Question:
Solve part 1 and 2
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
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 ... View the full answer
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
This case study relates to the following Course Learning Requirements: CLR 1: Install and use the Java Development and Runtime Environment and documentation libraries. Install and use the Eclipse...
-
Given the financial data in the table below for two mutually exclusive alternatives, determine the value "X" for the two alternatives to be equally attractive. Use an interest rate of 12% per year. P...
-
The comparative balance sheets for Montalvo Company show these changes in noncash current asset accounts: Accounts Receivable decreased $80,000, Prepaid Expenses increased $28,000, and Inventory...
-
A random sample of 10 miniature Tootsie Rolls was taken from a bag. Each piece was weighed on a very accurate scale. The results in grams were (a) Construct a 90 percent confidence interval for the...
-
a. Is a \(4 p ightarrow 4 s\) transition allowed in sodium? If so, what is its wavelength? If not, why not? b. Is a \(3 d ightarrow 4 s\) transition allowed in sodium? If so, what is its wavelength?...
-
Procter & Gamble is a well-known consumer products company that owns a variety of popular brands. A recent news article contained the following information: CINCINNATI, March 9...
-
You are given the following information on the macroeconomy: Consumption: 300 + 0.75Y Investment: 200 + 0.10Y Government Spending 500 Exports 100 Imports 50 + 0.25Y Compute the equilibrium level of...
-
If the financial statements cannot be relied upon because they contain one or more material departures from GAAP, what type of opinion will the auditor issue? Explain.
-
Mateo is a 8 month old infant who plays a baby on a tv show.he gets paid 1000 per show .he has 20 shows during the year. is this income taxable to little mateo ?
-
Rodrigo, a non-resident citizen, deposited his $2,000,000 savings in a 2-year time deposit in Blue Bank, a depositary bank under the expanded foreign currency deposit system. The deposit pays 8%...
-
1. (80pt) For each of the following languages, prove, without using Rice's Theorem, whether it is (i) in D, (ii) in SD but not in D, or (iii) not in SD. 1 L = { | {, ab, abab} CL(M)} 2 L2 = { | L(M)...
-
Toward the middle of the harvesting season, peaches for canning come in three types, early, late, and extra late, depending on the expected date of ripening. During a certain week, the data to the...
-
The goal is to make a digital representation of a car that can later be physically constructed. The primary requirement is for the car to move forward, without the need for any additional...
-
What is installment closed-end credit?
-
Using (1) or (2), find L(f) if f(t) if equals: t cos 4t
-
Use the computer results from Problem 9 of Chapter 8 to answer the following questions. a. Test H0: pYX1 = 0 and H0: pYX2 = 0. b. Test H0: pYX1|X2 = 0 and H0: pYX2|X1 = 0. c. Based on your results in...
-
Assume that a total of 75 subjects were tested in a balanced two-way fixed-effects factorial experiment. A plot of the means from the study is shown next. The dependent variable is Y, and the factors...
-
Consider the following four correlation matrices that apply to clusters having five responses per cluster: a. b. c. d. a. Matrix A is an example of what kind of correlation structure? b. Matrix B is...
-
The cells that carry oxygen to body tissues are (a) red blood cells. (b) white blood cells. (c) platelets. (d) hemoglobin.
-
Oxygen moves from the alveoli in the lungs into the bloodstream through the process of (a) active transport. (b) endocytosis. (c) diffusion. (d) exocytosis.
-
What stimulates the heart to beat?
Study smarter with the SolutionInn App