Program that prompts the user to guess the outcome of a die

Assignment Help Game Theory
Reference no: EM13945008

Question #1:

Develop a program that prompts the user to guess the outcome of a die throw. Then throw a die (using a random number generator) and inform the user if they guessed the correct outcome. Count the number of correct guesses. Develop the program using a separate class for the die. Your program should contain two separate java files, one for the main method and one for your die class. The interaction should be as follows:

Guess the outcome of the die throw (1-6, 0 to quit): 3
The throw of the die was 5, sorry...

Guess the outcome of the die throw (1-6, 0 to quit): 2
The throw of the die was 2, you win!

Guess the outcome of the die throw (1-6, 0 to quit): 8
A die only has six sides...try again...

Guess the outcome of the die throw (1-6, 0 to quit): 0
You guessed correctly 1 time.
Thanks for playing.

The die class must contain (at least) the following methods:

A constructor that initializes the die to some random side.

roll() - sets the die to a random side

getFace() - returns the current value of the die

equals() - returns true when the passed die is equal to the current die

compareTo() - compares two dice returning -1, 0 or 1

toString() - returns the string representation of the current die

Reference no: EM13945008

Questions Cloud

What process should be set up in advance : What are the four vital processes in disaster operations decision making when faced with a terrorist attack? What process should be set up in advance?
Range of specialised cognitive skills : Demonstrate a range of specialised cognitive skills required to work towards achieving improved effective inter-professional collaborative practice and how this can lead to better outcomes for service users
What processes affect the workers in this agency : What processes affect the workers in this agency? (How do people get their work, how are they evaluated, what expectations exist, and so forth.)
Bond equivalent yield on the issue of commercial paper : Charlie Stone wants to retire in 35 years(he is currently 22) and be able to withdraw $250,000 per year for 15 years. Charlie wants to receive the first payment at the end of the 35th year. Using annual interest rate of 10%, how much should Charlie d..
Program that prompts the user to guess the outcome of a die : Develop a program that prompts the user to guess the outcome of a die throw. Then throw a die (using a random number generator) and inform the user if they guessed the correct outcome
Outstanding preferred stock with market value : Your firm has 8 million shares of common stock outstanding with a market price of $7.00 per share. The company has outstanding preferred stock with a market value of $20 million, and 35,000 bonds outstanding, each selling at 92% of par value ($1000)...
Calculate the mean and variance of x : Calculate the mean and variance of X. Calculate the mean and variance of Y. Calculate the covariance and correlation between X and Y. Is there a positive or negative relationship between X and Y? Is the relationship strong, weak or moderate?
Auditing governance processes : Pick an institution and audit its governance processes according to the UK Commission's Principles of Good Governance. Your governance audit should:
Best situations to use linear programming versus : However, what are some examples of best situations to use integer programming versus linear programming? Best situations to use linear programming versus integer programming?

Reviews

Write a Review

Game Theory Questions & Answers

  Developing a study that is business oriented

Could you, please, help me in developing a study that is business oriented, maybe trying to investigate at what point business owners start feeling like they dislike what they do and feel discouraged.

  In the game of roulette-probability of winning

In the game of roulette, a player can place a $8 bet on the number 33 and have a 1/38 probability of winning. If the metal ball lands on 33, the player gets to keep the $8 paid to play the game and the player is awarded an additional $280.

  Confidence interval for population average weight of candies

Construct a 90% confidence interval for the population average weight of the candies.

  What is the value of the game

Consider the following two-person, zero-sum game. Payoffs are the  winnings  for  Player A. Identify the pure strategy solution. What is the value of the game?

  Would it be unusual for the mean of a sample

Assume that a population is normally distributed with a mean of 100 and a standard deviation of 15. Would it be unusual for the mean of a sample of 3 to be 115 or more? Why or why not?

  What is the dominant strategy

What is the dominant strategy and describe the Nash equilibrium or Nash equilibria, Why did they do this? Do you think that Sun Resorts cares about how many airlines will serve the island? Explain.

  Show that the game that results if player one is prohibited

Show that the game that results if player 1 is prohibited from using one of her actions in G does not have an equilibrium in which player 1's payoff is higher than it is in an equilibrium of G.

  How would you know how to store the letters

Have the random generator generate an "unused" letter, then STORE that letter into a global array/vector, etc.

  Does each firm have a dominant strategy

Does each firm have a dominant strategy? If so, explain and what that strategy is and what is the Nash equilibrium? Explain where the Nash equilibrium occurs in the payoff matrix.

  Defective orders in a fast-food restaurant

Burger Doodle is a fast-food restaurant that processes an average of 680 food orders each day. The average cost of each order is $6.15. Four percent of the orders are incorrect, and only 10% of the defective orders can be corrected

  Find the nash equilibrium

Which firm produces more in equilibrium? How do the quantities produced in equilibrium change if Firm 1 improves its technology, leading to a slightly lower

  You must work alone to complete this quiz do not share

you must work alone to complete this quiz. do not share answers or ideas with other students. write your answers

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd