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
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?
|