Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How to solve the basic jave problems? t A Create a user-defined class called Player that consists of the data and methods for the Player.

image text in transcribed
How to solve the basic jave problems?
t A Create a user-defined class called "Player" that consists of the data and methods for the Player. 1. (0.75 point) Declare the instance variables for Player name, contractValue and team representing the full name (first and last name) of the player their contract value and the team they play for. Also declare a class variable all Players Union representing the union's name for all the players, initiated allPlayers Union as kuonDsa 2. (1 point) Create two Constructors - a default constructor that have the following ("unknown ", 100000.0, Cubs), a non-default constructor that uses input parameters to sets all instance variables. Use the setter to set instance variables in the both constructors. 3. (0.75point) Three getter Methods: getName, getContractValue and getAllPlayerUnion - return the name, contractValue, allPlayers Union. 4. (0.75 point) Three setter methods - setContractValue, setName and setTeam that assigns values to the instance variables contractValue, name an team. 5. (0.75 point) A method getLastName that return the player last name. This method searches the index of the space in the name and return the last name as all the characters after the space index. 6. (1.25 points) A method formatedUnion that return the allPlayers Union as proper noun form, meaning starting with upper case and the rest of the word is lower case. 7. (1.25 points) Create a toString method that return the players information in the following form: name, contractValueFormated, team. The contractValueFormated is a formatted contractValue. To format the contractValue and get contractValueFormated : First, to create a decimal format object df, with pattern as " #. 00". So now you can format any number to have a pattern of always 2 decimal points. Then declare contactValueFormated and assign the outputformat method using contractValue as input invoked on df to contractValueFormated

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

Students also viewed these Databases questions

Question

understand how opening and closing stock is valued;

Answered: 1 week ago

Question

I am paid fairly for the work I do.

Answered: 1 week ago

Question

I receive the training I need to do my job well.

Answered: 1 week ago