+1 714-215-3097

(Solved) : Write Class Named Dartsector Constructor Accept Sector Number Position Single Double Trebl Q35538803

Write a class named DartSector. The constructor should accept asector number and position {Single, Double, Treble, Outer &Inner} represented with the integers 1 – 5 respectively. The classshould have 3 methods: • getSectorColor – method should return thepocket’s color (as a String) • singleThrow – method should generate2 random numbers; one in the range (1..20) and another (1..5); andreturn the score for the throw. • throwThree – method shouldgenerate 3 sets of random numbers, as above; and return the sum ofthe scores for these three throws. Demonstrate the class in aprogram that asks the user to select the number of throw desired (1or 3, validating user input is one of these), then calls theappropriate 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 aseparate line.

Leave a Reply

Your email address will not be published. Required fields are marked *