Design the algorithm used to implement the given game

Assignment Help Computer Engineering
Reference no: EM131273033

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: EM131273033

Questions Cloud

Explain the rhetorical situation of the text by focusing : Identify and explain the rhetorical situation of the text by focusing on the type of text, the target audience, the author, and the purpose. Remember that texts may have more than one audience and purpose. Use examples and evidence from the text t..
Understanding towards supply chain design : Provide your understanding towards Supply Chain Design relating it to any local or international company.
Discuss how the prominent early childhood theories : Discuss how the prominent early childhood theories (at least two) drive your administration, curriculum, instruction, and assessment. Describe your facility including the typical classroom environment, materials, and equipment in use to promote th..
Process for these two decision : 1. Your best and worst financial decision 2. What was different about your thought process for these two decision 3. How these differences lead to such different result 4. What lessons you've learned that you will apply to financial decisions
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.
Define the pertinent ethical issues : Define the pertinent ethical issues and points of ethical conflict based on the content and Identify the relevant affected parties (the stakeholders).
Process for these two decision : 1. Your best and worst financial decision 2. What was different about your thought process for these two decision 3. How these differences lead to such different result 4. What lessons you've learned that you will apply to financial decisions
List five journals that you found related to the key words : List five journals that you found related to the key words and choose one of them to summarize. Write a 2 page report (APA) summarizing the paper and how it relates to what you have learned in this module. At the end of your summary report, write ..
Could satyagraha be defined as standing aloof : Explore Thoreau's position and compare it with Gandhi's idea of satyagraha. How is it similar/different?- Could satyagraha be defined as "standing aloof"? Why or why not?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Questionthe most important public consulting firm has been

questionthe most important public consulting firm has been tasked with implementing an online patient care system that

  What is missing, incomplete, inaccurate

Email clients have to enable SSL encryption both for POP and SMTP. That way regardless of where we work, our email traffic would not expose any data to network eavesdropping techniques.

  Use the queue to reverse the elements of the stack

Write down a function template, reverseStack, that takes a parameter a stack object and a queue object whose elements are of the same type. The function reverseStack uses the queue to reverse the elements of the stack.

  Develop an application that randomly picks numbers

Develop an application that randomly picks numbers for all four games and displays the generated numbers in a GUI. Declare a method that generates a random number based on a range given.

  Create and extened class named suite

make a class named HotelRoom that includes an interger field for the room number and a double field for the nightly rental rate. Include get methods for these fields and constructor that requires an interger argument representing the room number.

  Express the definition of function print of the class two

express the definition of function print of the class two.

  Give most popular ways today to code a database application

Embedded SQL applications tend to lack interoperatiliby. Applications might have to modified to work with other RDBMS ODBC applications do not need the explicit declaration and use of host variables.

  What is the average memory access time

What is the average memory access time - Draw a pipeline diagram illustrating the first iteration of the loop assuming there are no instruction cache misses. Remember that there are two fetch stages

  You have been hired by tmi to design an application using

you have been hired by tmi to design an application using shell script programs. tmi case projects needs you to design

  Write an introspective capstone paper expressing your views

write an introspective capstone paper expressing your views aboutinformation use in todays society. this will be

  Explain about doing ethics technique

The Doing Ethics Technique (DET), ensuring you address each of the DET questions and relating specific clauses from this code to the ethical issue/s, you have identified.

  Web application test plan

Create a Web application test plan based on a real-life scenario involving a Web-based business which processes credit card information.

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