Write a java program that plays a two player dice game

Assignment Help Data Structure & Algorithms
Reference no: EM131266206

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

Reference no: EM131266206

Questions Cloud

What is peer learning : What is active learning? How could active learning principles be applied in a safety training course on machine guarding?
Write a program that asks for the users age : Write a program that asks for the user's age. Based on their response print "You can vote" (18 years old or older) or "You can't vote" and also whether or not he/she is a senior citizen (over 64). If senior citizen print "You're a Senior Citizen.
What problems could arise with this transition : What steps could you have taken when originally designing your system to best prepare for an eventual transition to a new certificate format?
Find a new product or system that uses a pm : Find a new product or system that was announced or released within the last three months. Conduct a security review of that product or system as described in Section 1.12. Pick one of the assets that you identified and construct an attack tree for..
Write a java program that plays a two player dice game : Write a Java program that plays a two player dice game called Guts. If a player rolls a 1, then the turns ends and the player receives no points for that turn.
Write a function that deletes kth element of the linked list : Write a function that returns the info of the kth element of the linked list. If no such element exists, terminate the program. Write a function that deletes the kth element of the linked list.
Find a new product or system that maintains long-term secret : Find a new product or system that was announced or released within the last three months. Conduct a security review of that product or system as described in Section 1.12. Pick one of the assets that you identified and construct an attack tree for..
Display a welcome message in a message dialog box : Display a welcome message in a Message Dialog Box (JOptionPane.showMessageDialog()) that includes the full name, e.g., "Welcome John Q Smith.".
Discuss an advertising campaign that you feel is successful : Discuss an advertising campaign that you feel was/is successful. - Why do you think it was so successful?- What was the target audience.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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