Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help creating a JAVA file called GameDice based off of this UML diagram: ________________________________________________________________________________________ Dice -numSides : int -primColor : String -secondColor :

I need help creating a JAVA file called GameDice based off of this UML diagram:

________________________________________________________________________________________

Dice

-numSides : int

-primColor : String

-secondColor : String

-numColor : String

-sideValue : int[]

<>Die(numSides : int, primColor : String, secondColor : String, sideValue : int[])

+getNumSides() : int

+getPrimColor() : String

+getSecondColor() : String

+getNumColor() : String

+getSideValues() : int[]

+setNumSides(numSides : int)

+setPrimColor(primColor : String)

+setSecondColor(secondColor : String)

+setNumColor(numColor : String)

+setSideValues(sideValues: int[])

+roll() : int

________________________________________________________________________________________

  • The first die has 20 sides, values 1-20, primary color is red and the secondary color is blue, the color of the numbers is silver
  • The second die has 10 sides, values 00, 10, 20, 30, 40, 50, 60, 70, 80, 90, the primary color is green and the secondary color is yellow, the color of the numbers is bronze
  • Display all of the attributes of each die. Then ask the user of the program if they want to play a game. If they do, ask which die they think will roll a 20 first. The first or second die? Take turns rolling each die until one of them finally roll a 20, displaying the value of each roll for each die. Once the 20 has been rolled, tell the user if they won or lost and ask if they want to play again.

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

Recommended Textbook for

Unity From Zero To Proficiency Beginner A Step By Step Guide To Coding Your First Game

Authors: Patrick Felicia

1st Edition

1091872023, 978-1091872028

More Books

Students also viewed these Programming questions

Question

please help me with my accounting 0 1 7 homework asap!! :)

Answered: 1 week ago