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

  Use the best-response approach to find all nash equilibria

Player 1 has the following set of strategies {A1;A2;A3;A4}; player 2’s set of strategies are {B1;B2;B3;B4}. Use the best-response approach to find all Nash equilibria.

  A supplier and a buyer, who are both risk neutral

A supplier and a buyer, who are both risk neutral, play the following game,  The buyer’s payoff is q^'-s^', and the supplier’s payoff is s^'-C(q^'), where C() is a strictly convex cost function with C(0)=C’(0)=0. These payoffs are commonly known.

  Pertaining to the matrix game theory problem

Pertaining to the matrix need simple and short answers, Find  (a) the strategies of the firm (b) where will the firm end up in the matrix equilibrium (c) whether the firm face the prisoner’s dilemma.

  Nash equilibria

Consider the two-period repeated game in which this stage game is played twice and the repeated-game payo s are simply the sum of the payo s in each of the two periods.

  Find the nash equilibrium

Two players, Ben and Diana, can choose strategy X or Y. If both Ben and Diana choose strategy X, every earns a payoff of $1000.

  Construct the payoff matrix for the game

The market for olive oil in new York City is controlled by 2-families, Sopranos and Contraltos. Both families will ruthlessly eliminate any other family that attempts to enter New York City olive oil market.

  Question about nash equilibrium

Following is a payoff matrix for Intel and AMD. In each cell, 1st number refers to AMD's profit, while second is Intel's.

  Finding the nash equilibrium

Determine the solution to the given advertising decision game between Coke and Pepsi, assuming the companies act independently.

  Nash equilibria to determine the best strategy

Little Kona is a small coffee corporation that is planning entering a market dominated through Big Brew. Each corporation's profit depends on whether Little Kona enters and whether Big Brew sets a high price or a low price.

  Creating a payoff table

Suppose you and your classmate are assigned a project on which you will earn one combined grade. You each wish to receive a good grade, but you also want to avoid hard work.

  Determine the nash equilibrium for trade policy

Consider trade relations in the United State and Mexico. Suppose that leaders of two countries believe the payoffs to alternative trade policies are as follows:

  Find the nash equilibrium outcomes

Use the given payoff matrix for a simultaneous move one shot game to answer the accompanying questions.

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