Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (10 points) Colors & Dart Board 5 20 parts501, Double 2x Single Single Treble 3x Single Single _Outer Bullseye (25 Poin Bullseye (50 Points)

image text in transcribed

image text in transcribed

1. (10 points) Colors & Dart Board 5 20 parts501, Double 2x Single Single Treble 3x Single Single _Outer Bullseye (25 Poin Bullseye (50 Points) 19 3 .com> On a dart board, the sectors are numbered from 1 to 20 with colors as follows: Sector 20 (12 o'clock position) is black with red double and triple inserts as shown on the board above Sector 1 (adjacent on clockwise side) is white with green double and triple inserts as shown on the board above Successively in turn following sector values and colors repeat this pattern: {18, 4, 13, 6, 10, 15, 2, 17, 3, 19, 7, 16, 8, 11, 14, 9, 12 & 5) Outer bullseye is green. Inner bullseye is red . * . . Scores other than bullseyes are the sector value x multiplier; bullseyes 25 & 50 points as indicated Write a class named DartSector. The constructor should accept a sector number and position {Single, Double, Treble, Outer & Inner; represented with the integers 1- 5 respectively. The class should have 3 methods: etSectorColor .\method should return the pocket's color (as a String) singleThrow- method should generate 2 random numbers; one in the range (L. 20) and another (1..5); and return the score for the throw. hrowThree - method should generate 3 sets of random numbers, as above; and return the sum of the scores for these three throws. Demonstrate the class in a program that asks the user to select the number of throw desired (1 or 3, validating user input is one of these), then calls the appropriate method to generate those throws; if a single spin, gives the resulting sector and color on the monitor; if 3 spins, uses a loop to display all the sectors and colors, each throw on a separate line. 1. (10 points) Colors & Dart Board 5 20 parts501, Double 2x Single Single Treble 3x Single Single _Outer Bullseye (25 Poin Bullseye (50 Points) 19 3 .com> On a dart board, the sectors are numbered from 1 to 20 with colors as follows: Sector 20 (12 o'clock position) is black with red double and triple inserts as shown on the board above Sector 1 (adjacent on clockwise side) is white with green double and triple inserts as shown on the board above Successively in turn following sector values and colors repeat this pattern: {18, 4, 13, 6, 10, 15, 2, 17, 3, 19, 7, 16, 8, 11, 14, 9, 12 & 5) Outer bullseye is green. Inner bullseye is red . * . . Scores other than bullseyes are the sector value x multiplier; bullseyes 25 & 50 points as indicated Write a class named DartSector. The constructor should accept a sector number and position {Single, Double, Treble, Outer & Inner; represented with the integers 1- 5 respectively. The class should have 3 methods: etSectorColor .\method should return the pocket's color (as a String) singleThrow- method should generate 2 random numbers; one in the range (L. 20) and another (1..5); and return the score for the throw. hrowThree - method should generate 3 sets of random numbers, as above; and return the sum of the scores for these three throws. Demonstrate the class in a program that asks the user to select the number of throw desired (1 or 3, validating user input is one of these), then calls the appropriate method to generate those throws; if a single spin, gives the resulting sector and color on the monitor; if 3 spins, uses a loop to display all the sectors and colors, each throw on a separate line

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago