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
-
MGT434 - Solve for MAD/MSE Assignment 6.1 Use the following forecast and actual sales date to solve assignment 6.1 Month Forecast Actual January 150 170 February 220 229 March 205 192 April 256 241...
-
PD.Q2: Use sensemaking arguments to help you understand the resulting expression for UG . How does this equation compare to the expression you found for v ? Specifically, how does d appear in both...
-
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...
-
Stirling's Formula (derived in Exercise 1.28), which gives an approximation for factorials, can be easily derived using the CLT. (a) Argue that, if Xi ~ exponentiall),i = 1,2,..., all independent,...
-
Many corporations are working toward developing products for which they can claim a zero-carbon footprint. A large manufacturing site uses 25,000 MWh electricity, which is the largest contributor to...
-
A cost sheet and partial finished goods ledger card for Leather Originals, a manufacturer of leather furniture, are provided in the Working Papers. Work independently to complete the following...
-
Fenner Smith is contemplating dividing his portfolio between two assets, a risky asset that has an expected return of 30% and a standard deviation of 10%, and a safe asset that has an expected return...
-
x(t)= |t|, -1
-
Determine the magnitude of the resultant force F R = F 1 + F 2 and its orientation , measured counterclockwise from the positive x axis. F = 260 lb 45 F=310 lb 12 5 13 y X
-
u hacen muchos estudiantes? Habl por telfono con sus amigos. Mir la televisin todo el da en su residencia. Asist a sus clases. Desayun . Visit a sus profesores durante las horas de oficina. Corr y...
-
Describe and explain personal pensions.
-
What are (a) NIM, (b) NII?
-
The company you work for needs to raise financing for a big expansion. Describe some of the markets it could make use of to raise finance.
-
What are collective funds?
-
How is a banks income statement split?
-
List and explain 2 non-survey ways that we can infer what the market expects future inflation to be.
-
Design an experiment to demonstrate that RNA transcripts are synthesized in the nucleus of eukaryotes and are subsequently transported to the cytoplasm.
-
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...
-
What do you understand by the term monetary policy?
-
Define open market operations by a central bank.
-
Explain monetary base, required reserves and excess reserves.
Study smarter with the SolutionInn App