Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a Java program that plays a two player dice game called Guts.

The rules of the game are

Players take turns rolling a single 6 sided dice.

If a player rolls a 1, then the turns ends and the player receives no points for that turn.

If a player rolls a 2 - 6, they have a choice to roll again or hold,

if they hold they receive the sum of all points gained in that turn added to their game total.

If they choose roll again, then they roll again.

The first player to a set number of points is the winner.

Uses a Scanner object to ask for the users name. The users name is ***** ***** the following message: Welcome 's name> to a game of Guts.

The game will be played against the computer.

The game will start once the user enters their name.

The first roll will occur automatically.

Each roll will display the rolled value, the total for that roll and the current game total.

After the first roll the player will be asked to enter an ‘r' to roll again or a ‘h' to hold. The program must accept upper or lower case values.

Use the Math.random method from the Java API Math class to randomly roll the dice.

The computers roll will follow the following algorithm

The computer will keep rolling until its turn has at least 15 points.

Once 15 points or more has been reached the computer will hold.

The computers max points per turn will be stored in a constant.

The first player to reach or exceed the specified score wins. To keep things simpler, don't evaluate the current score against the winner score until after the turn is completed.

The specified winning score should be stored in a constant. That value should set to 50 points

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92020959
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Discuss how the scope of computer security grew from

Discuss how the scope of computer security grew from physical security to include : Securing the data Limiting random and unauthorized access to that data. Involvement of personnel from multiple levels of the organizatio ...

In linux what synchronization methods they use within the

In Linux what synchronization methods they use within the kernel, please dig into your findings for Linux.

Assignment week 5 user acceptance testinguser acceptance

Assignment: Week 5 User Acceptance Testing User acceptance testing, or UAT, is a round of testing in which the users who are expected to use the system after it goes live exercise the system. UAT differs from quality ass ...

Question when setting quotas for disk space what are the

Question : When setting quotas for disk space, what are the two tools for enabling and configuring quotas? And which of the two are the more flexible? When creating a new share, what is the configuration option that enab ...

Describe how to discover cookies on web browsers what is a

Describe how to discover cookies on web browsers. what is a reverse DNS lookup and can it be used when attacking the network.

Question suppose a process in host c has a udp socket with

Question : Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each send a UDP segment to Host C with destination port number 6789. Will both of these segments be directed t ...

What is the importance of selling and salesmanship within a

What is the importance of selling, and salesmanship within a small business?

A measurement of etch depth has standard deviation of 2 um

A measurement of etch depth has standard deviation of 2 um. The specifications are 150 to 200 um. If k = 6, what is the P/T ratio of the measurement? Please show the formula/steps taken to receive the answer.

Reflective journal entryreflective journal entry on writing

Reflective Journal Entry Reflective Journal Entry on writing a Bibliography Assignment Topic; Research Question: One of the most common questions that new students learning programming students ask is what programming la ...

Wat type of malware do you think is the most destructive

What type of malware do you think is the most destructive : viruses, worms, trojan programs, spyware or adware.

  • 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