IN1105- Introduction to Programming Part 1: Problem analysis Identify all variables needed by the program Provide...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
IN1105- Introduction to Programming 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 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 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) 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 roll 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. Better luck next time! Sample Execution 2: 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! IN1105- Introduction to Programming 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 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 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) 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 roll 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. Better luck next time! Sample Execution 2: 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! IN1105- Introduction to Programming 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 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 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) 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 roll 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. Better luck next time! Sample Execution 2: 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! IN1105- Introduction to Programming 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 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 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) 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 roll 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. Better luck next time! Sample Execution 2: 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!
Expert Answer:
Related Book For
Introduction to Operations Research
ISBN: 978-1259162985
10th edition
Authors: Frederick S. Hillier, Gerald J. Lieberman
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Wansley Portal Inc., a large Internet service provider, is evaluating the possible acquisition of Alabama Connections Company (ACC), a regional Internet service provider. Wansley's analysts project...
-
In Figure 9.2, identify the market and optimal outcomes. Does the market under or overproduce public goods? FIGURE 9.2 M (market outcome) X (optimal outcome) Markets underproduce public goods. PUBLIC...
-
Show that the result of Exercise 53 can be written as Data from in Exercise 53 Let be a positive, continuous, and decreasing function for x 1, such that a n = (n). Prove that if the series...
-
What are the different types of schemes associated with complex frauds?
-
Matthew owns 30 percent of the outstanding stock of Lindman and has the ability to significantly influence the investees operations and decision making. On January 1, 2015, the balance in the...
-
Defining the database management system and identifying the differences between a database and a database management system (DBMS) or relational database management system (RDBMS). Please provide the...
-
Nautilus Resources is investing in a new heavy oil upgrader in northern Alberta. Nautilus has hired Rite Build Contractors to construct the facilities. The contract price is $3,600 million to be...
-
Question 10 (6 points) On December 31, 2021 Alto Company's records showed the following results for the year: $ 110,000 $ 955,000 In addition, the unadjusted trial balance included the following...
-
During 2021, an historical fiction author traveled to Boston to take a summer course about Colonial history. She did so to research her next book. She spent $300 for airfare, $400 for lodging, $200...
-
Use the definite integral to find the area between the x-axis and f(x) over the indicated interval. f(x) = xe ; [0,3] The area is (Type an integer or decimal rounded to three decimal places as...
-
[2] 7. Factor the following. a) y = 10x + 20x
-
Solve by the substitution method. x - y = -6 9x + 8y = -88
-
Calculate percentage tax? Solar Sports, Inc. is a sports promoter which leases the Araneta Coliseum at a monthly rental of P900,000. It conducts boxing exhibitions and professional basketball games...
-
Critically evaluate the advantages of using the financial systems in lending and borrowing processes.
-
1. Advertising for eyeglasses _________ (increases/decreases) the price of eyeglasses because advertising promotes _________. 2. An advertisement that succeeds in getting consumers to try the product...
-
From the tenth floor of her office building, Katherine Rally watches the swarms of New Yorkers fight their way through the streets infested with yellow cabs and the sidewalks littered with hot dog...
-
Consider the birth-and-death process with the following mean rates. The birth rates are 0 = 2, 1 = 3, 2 = 2, 3 = 1, and n = 0 for n > 3. The death rates are 1 = 3, 2 = 4, 3 = 1, and n = 2 for n > 4....
-
Consider the following problem. Maximize Z = x1 x2, Subject to and x1 ¥ 0, x2 ¥ 0, (a) Solve this problem graphically. (b) Use the dual simplex method manually to solve this problem. (c)...
-
How does a judge decide a case when there is no precedent available in earlier decisions?
-
What is a class action and when do parties use them?
-
One of the major purposes of private law is to settle disputes between businesses. How can the settlement of a particular private dispute make a contribution to the business community as a whole?
Study smarter with the SolutionInn App