Question: NEEDS TO BE IN JAVA AND ALSO NEEDS TO BUILD AND RUN PLEASE For this homework you will make a class for a Player object.

NEEDS TO BE IN JAVA AND ALSO NEEDS TO BUILD AND RUN PLEASE

For this homework you will make a class for a Player object. This class should have the following instance variables:

player's name

player's score

an array of 5 integers to represent the value rolled by 5 (6 sided) dice

You should make the following methods for your class:

the default constructor

a constructor to initialize the players name and 5 int variables that are in the array data variable (they represent the dice values)

the setters and getters for all of the instance variables

a toString method that should output the value of all of the variables

an method with the following method header public int hasValue( int value) - this method should take in as a parameter a value of a dice (a number from 1-6) and return the number of dice that have that value

Make a test class that tests each method at least once.

USING JAVA

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!