The player class: Attributes: String firstName, lastName int idNumber, chips All
ID: 3638496 • Letter: T
Question
The player class:Attributes:
String firstName, lastName
int idNumber, chips
All attributes are private.
Constructors:
Three constructors:
1 - a default constructor – nothing in the parameters and every value blank or zero.
2 - A constructor with four parameters, first name, last name, idNum, chips
3 - A constructor with two parameters idNum and chips. Use scanner to have the user enter the first name and last name.
Methods:
The methods to be created are:
Getters and setters for each attribute.
o Getters (observer) returns the value of each attribute.
o Setters takes as input 1 parameter and sets the value of an attribute
? Additionally create three methods: addChips, subChips, displayPlayer
o addChips will take a integer parameter (int data type) and add it to the total chips;
o subChips will take an integer parameter (int data type) and subtract it from the total chips.
Explanation / Answer
.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.