Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Game Theory Expert

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

Game Theory, Economics

  • Category:- Game Theory
  • Reference No.:- M91615871
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Game Theory

In this assessment task you will take the role of an expert

In this assessment task you will take the role of an expert economist, employed by a government department or regulatory authority. Decision-makers in government rely on the advice of experts, like you, when formulating ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As