C++ How to Program (10th Edition)
C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 7.18E

(Craps Game Modification) Modify the program of Fig- 6.9 to play 1000 games of craps.
The program should keep track of the statistics and answer the following questions:

  1. How many games arc won on the 1st roll, 2nd roll.. 20th roll. and after the 20th roll?
  2. How many games are lost on the 1 st roll, 2nd roll, 20th roll. and after the 20th roll?
  3. What are the chances of winning at craps? [Note: You should discover that craps is one of the fairest casino games. What do you suppose this means?]
  4. What's the average length of a game of craps?
  5. Do the chances of winning improve with the length of the game?

Blurred answer
Students have asked these similar questions
Problem D: Different Dice Game Consider the following game for two players: The first player rolls a pair of dice of fair six-sided dice. If the two dice show different numbers, the player's score is the larger of the two numbers. Otherwise, the player's score is the sum of the two numbers. At this point, the player is asked if they want to remove their lower die and re-roll one die. If they say no, the player keeps her score and their turn is over. If they say yes, then they roll one more die and the number showing on this die replaces the lower of the original two rolls. Then these two dice rolls are scored accordingly. (For example, if the initial roll was a 2 and 5, if the player doesn't roll again, she gets 5 points. If she does roll again and obtains a 4, her score is still 5. If she rolled again and obtained a 6, her score would be a 6. If she rollwed again and obtained a 5, her score would be a 10.) The second player goes after the first, doing the exact same steps as the first…
[Fish Tank] You play with a clown fish that has an initial size so. The fish can eat other fish in a tank organized in m columns and n rows. The fish at column i and row j has a positive size si,j. When your fish eats another fish, it grows by that amount. For example, if your clown fish has a size of 10 and eats a fish of size 5, it becomes of size 15. You cannot eat a fish that is bigger than your size. The game starts by eating any fish in the first (left-most) column that is not bigger than yours. After that, you advance one column at a time by moving right. You have only three allowed moves. You either stay at the same row, move one row higher or one row lower. You will always move to the right. Thus, you will make exactly m moves to advance from left to right. Your goal is to exit the fish tank from the right with the biggest possible size. The figure below shows an example with the best answer highlighted. In this case, the final fish size is 71 (10+8+7+24+22). You are required…
a) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for the number of points to risk and a second prompt asks the player to choose either High or Low. The player’s choice of either High or Low is compared to random number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, then it is considered “low”. A number between 8 and 13 inclusive is “high”. The number 7 is neither high nor low, and the player loses the points at risk. If the player had guessed correctly, the points at risk are doubled and added to the total points. For a wrong choice, the player loses the points at risk. Create a HiLo application based on this specification. Application output should look similar to: b) Modify the application to allow the player to continue until there are 0 points left. At the end of the game, display the number of guesses the user took before running out of points. This is my code I just need part b import java.util.Random; import…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Literals in Java Programming; Author: Sudhakar Atchala;https://www.youtube.com/watch?v=PuEU4S4B7JQ;License: Standard YouTube License, CC-BY
Type of literals in Python | Python Tutorial -6; Author: Lovejot Bhardwaj;https://www.youtube.com/watch?v=bwer3E9hj8Q;License: Standard Youtube License