Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92027758
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question what are the requirements for dfs what are

Question : What are the requirements for DFS? What are benefits of using DFS? What are the shortcomings and limitations? The response must be typed, single spaced, must be in times new roman font (size 12) and must follo ...

The economic dynamism which is the index of productive

The economic dynamism, which is the index of productive growth in dollars for countries that are designated by the World Bank as middle-income are in table #8.3.9 ("SOCR data 2008," 2013). Compute a 95% confidence interv ...

1 what is the purpose of exclusive gates such as the xor

1. What is the purpose of exclusive gates such as the XOR and XNOR? 2. What function do these gates perform?

Suppose you are asked to automate the prescription

Suppose you are asked to automate the prescription fulfillment system for a pharmacy, MailDrugs. When an order comes in, it is given as a sequence of requests, "x1 ml of drug y1," "x2 ml of drug y2," "x3 ml of drug y3," ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Question suppose that 80 community delegates discussed the

Question : Suppose that 80 community delegates discussed the transportation problems on Oahu. 30 of them favor expanding the bus system, 34 favor introduction of rail, and 44 favor building more highways. 15 favor a comb ...

Reminder all files must be closed when you are done with

Reminder: All files must be closed when you are done with them, even if it stops early due to an IOError. If you're using with, this will happen automatically. If you're trying to close things manually using .close(), th ...

Mccann co has identified an investment project with the

McCann Co. has identified an investment project with the following cash flows. Year Cash Flow  1     $800   2    1,090   3    1,350   4    1,475  a. If the discount rate is 7 percent, what is the present value of these c ...

Need help with calculation problem and design a program to

Need help with Calculation Problem and Design a program to input two numbers. Calculate the sum, the difference, the product, and the quotient. Display the answers. Car Rental Problem The Sports Car Rental Company rents ...

Discuss the criteria necessary to establish a factor as a

Discuss the criteria necessary to establish a factor as a confounder and provide an example applying these criteria?

  • 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