Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Java program that simulates the tossing of a darts until the score first equals or exceeds 1000 when the game ends. Assume that

image text in transcribedimage text in transcribedWrite a Java program that simulates the tossing of a darts until the score first equals or exceeds 1000 when the game ends. Assume that each region is as likely to be hit by a dart.

Darts thrown at a dart board land in different regions of the board, and a value or score is assigned accordingly. The total score is the sum of the values scored for each toss. Figure shows two views of a dart board which shows the regions on the board and the corresponding values or scores which we will consider for this question. 9 10 Point Values Regions Write a Java program that simulates the tossing of a darts until the score first equals or exceeds 1000 when the game ends. Assume that each region is as likely to be hit by a dart. At the end of the game display the number of times each region was hit, the total score for each regiorn and the total score for the game. You will need two 1-D arrays: one to keep track of the point values of each region and one to keep track of the number of times each region was hit. You will also need to use a Random number generator to simulate the tossing of the dart. We recommend using the nextInt() method of the Random class. Here are a couple of sample runs to illustrate the expected behaviour of your program. (Note there is no user input for this question)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions