Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help due soon SNAKE EYES CSC110AA and CIS163AA Chapter S Activity 7-Die Class Both die are 1 1 Implement the Die class based

I need help due soon
image text in transcribed
SNAKE EYES CSC110AA and CIS163AA Chapter S Activity 7-Die Class Both die are 1 1 Implement the Die class based on the UML below. It represents one die (singular of dice) with faces having values 1 to a maximum value // current value showing on the die (1 to maxValue private int faceValue int maxValue the maximum face value allowed public Diel0 // constructor. faceValue set to 1, maxValue set to t6 public void setFaceValue(int value)//faceValue set to value if between 1 and maxValue //otherwise no change to faceValue //returns the object's current faceValue //randomly generates a number between 1 and maxValue public int getFaceValue() public void roll) //sets the facevalue to this number public String toStringi0 /freturns the current state of a die object (instance variable values) 2. Test with TestDie java. Begin with the public class TestDie public static void main(Stringl 1 args) //create a Die object called die //display the state of object die1 //set the faceValue of die1 to 4 //display the state of object die1 //set the faceValue of die1 to 15 //display the state of object die1 //roll diel //display the faceValue of die1 The output from TestDie.java: Beginning state of die1: faceValue: 1 maxValue: 6 State of diel after setting faceVallue to 4: faceValue: 4 maxValue:6 State of diel after attempting to set faceValue to 15: faceValue:4 maxValue :6 The facevValue of die1 after a roll:S (not able to change foceValue to 15 so remains 4) the foceVolue shouild be any number between 1-6) 3. Submit Die.java and TestDie.java (with output included). 4. Challenge (if you have time): Download DiceGame.java. It also uses the Die class. Examine the code and add the features indicated. Your output should resemble the output given in DiceGame.java. 5. Submit Die.java, TestDie.java, and DiceGame.java

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

Where those not participating, encouraged to participate?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

4. What will the team agreement contain?

Answered: 1 week ago