Make getters and setters for diceType and lastRoll.

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

In the Dice.Java file: create a class called Dice. Your class should have the following elements:
1. a class variable string array called DICENAME with the following different names dice:
Tetrahedron( 4 faces )
Cube( 6 faces )
Octahedron( 8 faces)
Pentagonal trapezohedron( 10 faces )
Dodecahedron( 12 faces )
Icosahedron( 20 faces)
Zocchihedron ( 100 faces)
For the purposes of this exercise, assume that there is one number per face, even though 4 faced dice are often only 2 numbers. So if it has 4 faces, it represents numbers 1-4, if it has 100 faces, it represents numbers 1-100.
2. Make a second class variable array called FACES, this time an int array representing the number of faces for each die. Make sure the index number representing the faces in your FACES array matches with the corresponding dice name in your DICENAME array, for example if Tetrahedron is at DICENAME[0] then 4 should be at FACES[0].
3. Make two instance variables called diceType and lastRoll both int. diceType will store the index number in DICENAME of type of die the object represents and lastRoll will store the value of the die last time it was rolled.
4. Make two constructors. The first should be triggered when an object is created with no arguments and should set diceType and lastRoll. Note: lastRoll should have a plausible value, if the dicetype is Cube, which has only 6 faces, the last roll should not be 15. The second constructor should take two ints as arguments and allow the value of diceType and lastRoll to be passed in and set.
65 Make a non-static roll() method that takes no arguments and uses the value set in diceType in your object to look up the number of faces in FACES, then rolls a value with that number inclusive. Note: you’ll want to put a plus one outside of your random nextInt() to achieve this. It should then set lastRoll to that value.
6. Make getters and setters for diceType and lastRoll.
7. Make a toString() and equals() method for the class. For equals, both the type of die and the last roll must be the same for them to be equal. For toString, make sure to print the name of the die, not just the number of faces, and also the last roll. A reminder that toString() does not print a string, it returns it.

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services