Design the algorithm used to implement the given game

Assignment Help Computer Engineering
Reference no: EM131273051

You are required to implement a program that will simulate a dice game played by five players. In the game a player takes five dice and the score is calculated based on a set of rules and the dice are passed to the next player. The game finishes at the end of at the round where one of the players reaches a score of 200.

Type of score 

Descriptions 

Example 

Score 

Five of a kind 

All dice have the same score 

1,1,1,1,1 or 5,5,5,5,5 

50 

Full House 

Three of one value and two of another value 

1,1,1,5,5 or 2,2,3,3,3 

25 

Four of a kind 

Four dice with the same value 

3,3,3,3,5 or 4,5,5,5,5 

Sum of all 5 dice 

Three of a kind 

Three dice with the same value 

2,2,2,5,6 or 1,3,5,5,5 

Sum of all 5 dice 

Your program should meet the following requirements:

The program must simulate a game with 5 players and 5 dice.

Every player rolls five dice and the score is added to the player's total score after applying the rules of the game. If the dice values do not follow any of the four rules, the player's score for this round is 0.

A round finishes when the five players have cast the dice and all the scores have been added to the players

The program finishes after a round when at least one player has got a total score greater or equal to 200. If more than one player has reached a total score of more than 200, the one with the highest score wins.

Once the game is complete, the winner must be displayed.

What you need to do

You have to use arrays and methods in the design of your program. Classes can be used but they are not necessary and you won't be penalised for not using classes. You have to design the program that simulates the game using an algorithm that reflects the implementation.
You should create a well-structured Java program that uses the concepts that we have learned up to this point and makes sensible use of comments.

You should carry out testing of your program. You should work out a sensible way to test that the program works by tracing the simulation of the game.

1. Design of the program. The design involves a description of the way that you organised the information and the design of the program

Description of the data types used to store the information (players, dice, scores...)

Design of the algorithm used to implement the game.

Description of how you tested the program and explanation of the results. Since your program is a simulation you should use print statements to check that game is played following the rules. You should also provide a description of problems encountered and how you have solved them or failed to solve them.

Implementation. Please cut and paste your code into the word-processed document that you submit. Your code should be in a fixed-pitch font such as Courier and indented sensibly. You will gain marks for :

• Declaration of suitable variables and correct use of data types to store the game's data.

• Implementation of the game with loops and if statements.

Reference no: EM131273051

Questions Cloud

What is main difference between lytic and lysogenic cycle : What is the main difference between the lytic and lysogenic cycle? What is a temperate phage? What is lysogeny? In your own words, what proteins and promoters are involved in the induction of the lytic cycle.
Understanding towards supply chain design : Provide your understanding towards Supply Chain Design relating it to any local or international company.
What is main difference between lytic and lysogenic cycle : What is the main difference between the lytic and lysogenic cycle? What is a temperate phage? What is lysogeny? In your own words, what proteins and promoters are involved in the induction of the lytic cycle.
Most important stage of the sales process : Some trainers and sales experts think that closing is the most important stage of the sales process. Do you feel this way? What is an example where you have observed a great closing or a missed opportunity when a closing should have been made.
Design the algorithm used to implement the given game : Design of the algorithm used to implement the game. Design of the program. The design involves a description of the way that you organised the information and the design of the program.
What are the genotypes of the parents : What are the genotypes of the parents? What phenotypic ratio was expected in the offspring generation? How many of the 8 bunnies were expected to be long-haired?
Most important stage of the sales process : Some trainers and sales experts think that closing is the most important stage of the sales process. Do you feel this way? What is an example where you have observed a great closing or a missed opportunity when a closing should have been made.
Are the staff in this agency self-aware : Based on the readings, how would you define personal values? What values do the staff of this agency hold? Are these values a good match for quality human services work? Explain.
Select a work of art of your choice from museums : Select a work of art of your choice from any of the interactive museums provided in Week One, see attachment or from your local art museum. Contemplate the work of art and add your interpretation of the art.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Consider architecture a that has the addressing

Consider architecture A that has the addressing modes below for the ADD instruction. Based on the ADD instruction, is this architecture better be encoded as a fixed-length instruction or a variablelength

  What are the ways a device can become infected

The spread of the mobile viruses has been slow since the mobile devices lack a prevalent OS like PCs and Windows. As mobile communications become more prevalent, so does the onslaught of viruses.

  Assignment on combinational logic design

To design a logic circuit that will indicate whether a 4-bit binary input is exactly divisible by 3, 5. or 7. That is. the output will be a logic ' 1' when the input is divisible by any of the above 3 numbers, i.e. 3.5 or 7.

  Define the german transportation otto bonn

First assignment is: Problem Description: The German transportation Otto Bonn is expanding his trucking business into Florida, with shipping centers in Daytona Beach, Gainesville, Jacksonville, Miami, Tallahassee, and Tampa.

  Do research to find an example of a company that provides

where do firms go when the want to outsource information systems development?do research to find an example of a

  Kind of constraint that stipulates

Kind of constraint that stipulates that a user can be assigned to a role only if that user was already given another role.

  Explain removing zoogloea from wastewater

Removing Zoogloea From Wastewater, Problem statement: A 1 million gallon per day biological wastewater treatment system received influent wastewater containing high concentrations of organic acids (especially acetic acid)

  Multicast routing paradigm

The data-driven multicast routing paradigm works best on the local networks which have low delay and excess capacity, however the demand driven paradigm works best in the wide are environment which has limited capacity and higher delay.

  How to maintain inventory data on resources stored

give an eLibrary system where patrons can search a database to retrieve either the location of an actual resource in the library or an electronic copy of the source.

  Make use of an array for the different loans

Write down the program in Java (without a graphical user interface) using a loan amount of $200,000 with an interest rate of 5.75% and a 30 year term.

  Assume homogeneous array with 6 rows and 8 columns

imagine that a homogeneous array with 6 rows and 8 columns, is stored in row major order starting at address 20 (base ten). If each entry in the array requires only one memory cell.

  Converting the skip list l into binary search tree t(l)

Any skip list L can be converted into binary search tree T(L)as follows: The root of T(L) is considered as the leftmost node on the highest non-empty level of L the left and right sub-trees.

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