Question
in c++, using this template, try to make it simple.

In the Going to Boston Dice game, your computer throws three 6-sided dice. On the first throw, the h or more of the dice show
0 0
Add a comment Improve this question Transcribed image text
Answer #1

2, 5, 4-> 5 I 2, 6-> 6 I 2 => 13 l You have $98 5, 1, 4-> 5 I 2, 3-> 3 I 2=> 10 1 You have $99 3, 2, 6-> 6 I 5, 1-> 5 1 1 =>6,6,5-> 6 | 5, 6-)615=> 17 1 You have $94 1, 1, 5-53, 6 -66-17 You have $88 2, 4, 2-> 4 16, 2-> 6 | 3=> 13 1 You have $86 , 1#include<cstdlib>
#include <iostream>
using namespace std;
int main()
{
int amount = 100;
for(int i = 0; i < 10; i++){
int sum = 0;
int r1 = (rand() % 6) + 1;
int r2 = (rand() % 6) + 1;
int r3 = (rand() % 6) + 1;
int max1 = r1>r2 ? r1 : r2;
max1 = max1>r3 ? max1 : r3;
sum += max1;
cout << r1 << ", " << r2 << ", " << r3 << " -> " << max1 << " | ";
  
r1 = (rand() % 6) + 1;
r2 = (rand() % 6) + 1;
max1 = r1>r2 ? r1 : r2;
sum += max1;
cout << r1 << ", " << r2 << " -> " << max1 << " | ";
  
max1 = (rand() % 6) + 1;
sum += max1;
amount += 11-sum;
cout << max1 << " => " << sum << " | " << "You have $" << amount << endl;
}
cout << "Bye..." << endl;
return 0;
}

Add a comment
Know the answer?
Add Answer to:
In the Going to Boston Dice game, your computer throws three 6-sided dice. On the first throw, th...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • What is the most likely outcome when we throw two fair dice, i.e., what is the most likely sum th...

    What is the most likely outcome when we throw two fair dice, i.e., what is the most likely sum that the two dice would add to? Why? This problem can be solved by first principles. The probability P(E) for an event E is the ratio |E|/|S|, where |E| is the cardinality of the event space and |S| is the cardinality of the sample space. For example, when we throw a fair die, the event space is S = {1,2,3,4,5,6} and...

  • Example Consider the following dice game. A pair of standard ( fair ) dice are repeatedly...

    Example Consider the following dice game. A pair of standard ( fair ) dice are repeatedly rolled. If a ’ 7 ’ comes up before an ’ 11 ’ , then the player wins, otherwise the player loses. Let W be the event that the player wins. Find P(W). To say the dice are fair is equivalent to assuming that Laplace’s rule holds and the 36 possible outcomes for a throw of the dice are equally likely. For convenience, an...

  • Anyone can help with this? 6 Points You are to throw six dice simultaneously and observe...

    Anyone can help with this? 6 Points You are to throw six dice simultaneously and observe the topside of each die. Q1.1 3 Points What is the probability of getting triple pairs? (i.e. 2, 2, 4, 4, 1, 1) Enter your answer here

  • The Dice game of "Pig" can be played with the following rules. 1. Roll two six-sided dice. Add the face values...

    The Dice game of "Pig" can be played with the following rules. 1. Roll two six-sided dice. Add the face values together. 2. Choose whether to roll the dice again or pass the dice to your opponent. 3. If you pass, then you get to bank any points earned on your turn. Those points become permanent. If you roll again, then add your result to your previous score, but you run the risk of losing all points earned since your...

  • You and a friend are rolling a set of 6 dice. The game works such that...

    You and a friend are rolling a set of 6 dice. The game works such that if a die shows the values 1, 2, or 3 you will get a point for that die. Each die that shows 4, 5, or 6 your friend will get a point for. Construct a probability model for a single roll of the dice then answer the following. A)What is the probability you made 2 points? B)What is the probability that your friend will...

  • A dice game is played with two distinct 12 sided dice. It costs $3 to roll...

    A dice game is played with two distinct 12 sided dice. It costs $3 to roll the pair of dice one time. The payout scheme is as follows 1. Sum of 13 pays $10 Sum of 11 or 15 pays $6 Sum of 7, 9, 17, or 19 pays $3 Any other roll doesn't pay. What is the expected gain/loss after playing the game one time? A "fair" game is one in which the expected gain/loss after playing once is...

  • Assume that you suspect that a dice has been tampered with. You throw the dice 36...

    Assume that you suspect that a dice has been tampered with. You throw the dice 36 times and record the number of times each value on the dice occurs in the table below. Conduct a hypothesis test to see if this dice is considered to be a fair dice (good dice and, therefore, has not been tampered with) at an α=0.01 Table 1. Observed frequency (O) of the number of dots of die Number of dots Observed frequency 1 9...

  • Create a Dice Game: PYTHON This game is between two people. They will roll a pair...

    Create a Dice Game: PYTHON This game is between two people. They will roll a pair of dice each 10 times. Each roll will be added to a total, and after 10 rolls the player with the highest total will be the Winner! You will use the RANDOM class RANDRANGE to create a random number from 1 to 6. You'll need a function for "rollDice" to roll a pair of dice and return a total of the dice. You must...

  • Exercise I: More dice rolls You repeatedly throw a dice. 1. Compute the probability of the...

    Exercise I: More dice rolls You repeatedly throw a dice. 1. Compute the probability of the following events. Write these events precisely using other events, and say where you use assumptions such as independence or disjoint- ness. Give your results as a single simplified fraction. (a) The first roll is even and the second one is odd. (b) The first five rolls are even. (c) The first roll is even and the second one is odd, or the first roll...

  • Problem 5, 10 points Roll three (6-sided) dice. Use inclusion-exclusion to find the probability that at...

    Problem 5, 10 points Roll three (6-sided) dice. Use inclusion-exclusion to find the probability that at least one value of "2" appears. Hint: Consider A, to be the event that the ith dice shows a "2" for i 1,2,3. We want to find P(A1 UA2U A3) using PI.E. for 3 events. You can assume that each dice is fair, that is, P(A) 1/6, P(Ai n A) 1/6x 1/6-1/36 and P(An A2nA3) (1/6)3 1/216. For an easier solution, consider the complement...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT