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

  Create program algorithm in pseudocode to store quiz grades

The elementary school for which you are doing development work has asked you to create a program algorithm in pseudocode to store quiz grades for the students of a class

  Question 1 consider we implement a priority queue as a heap

question 1 consider we implement a priority queue as a heap. suppose the queue has thousands of elements. consider

  Find all the cut-vertices and cut-edges in the given graph

Find all possible isomorphism types of the given kind of simple graph? Draw a forest having ten vertices, seven edges, and three components? Find all the cut-vertices and cut-edges in this graph below?

  Show the postfix expressions

An infix expression is one in which operators are located between their operands - Pop the stack elements and add them to the queue (PostQueue) one by one until the top of the stack has an element of lower precedence

  Construct two gene expression clustering algorithms using r

CLUSTERING GENE EXPRESSION DATA USING R LANGUAGEConstruct two gene expression clustering algorithms using R.Select the best algorithm and construct a third improved algorithm.

  Creating a bash script

Create a Bash script that will prompt for the user's first and last names and store the responses in two variables. Then it will show the stored data in the format "You entered lastname, firstname."

  Design greedy algorithm to solve activity selection problem

Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ... an that wish to use a lecture hall. Each activity ai has a start time siand a finish time fi.

  Create a chart for each sales person in the categories

Open Excel and start with a blank spreadsheet. In cell A10 type in the words "iHaul Sales Force Facts and Figures" - do not use quotes, do use font size 16, and make the text bold.

  Create a classification model for letter recognition

Create a classification model for letter recognition using decision trees as a classification method with a holdout partitioning technique for splitting the data into training versus testing

  Write efficient pseudocode algorithm to determine record

Write the most efficient pseudocode algorithm you can to determine the record with specific customerID if every single customer ID from 101 to 500 is used and array has 400 elements.

  Describing the data types

Create a 10-12 slide presentation describing the data types. Include the following in your presentation: Introductory slide and Slide for each data type

  Create the adt for a binary search tree

Create the ADT for a binary search tree using the array implementation. In an array implementation, the pointers become indexes to the sub tree elements.

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