Question: Create a class called Employee it will have the following attributes (Java): name - which is a String salary - which is a double months

Create a class called Employee it will have the following attributes (Java):

name - which is a String

salary - which is a double

months employed - which is an integer

job type - which is a String

Your class needs to have the following methods:

Employee - constructor that sets all the attributes above

Employee - default constructor that sets default values for all the attributes

getName - returns the name

setName - sets the name value

getSalary

setSalary

getMonths

setMonths

getJobType

setJobType

toString -

updateSalary - this method will accept a decimal number, like .03, for 3 % and raise the salary appropriately. It could also be set to take a negative value like -.05 and adjust the salary down. Hint: multiplying the current salary by 1+ entered percent provides the updated salary, i.e. if a salary of 50000 is increased by .04 then multiplying the 50000 by 1.04 will provide the updated salary.

Instance 1:

name - Fred Flintstone

salary - 35000.00

months - 181

job type - crane operator

- print out this information after creating the above object.

Execute the following methods per instructions below

setName ("Fred A. Flintstone")

setSalary(41000)

setMonths(193)

setJobType("Supervisor")

updateSalary(.05)

- print out the object again to verify the information

Instance 2:

name - Barney Rubble

salary - 30000.00

months - 101

job type - driver

- print out this information after creating the above object.

Execute the following methods per instructions below

setName ("Barney T. Rubble")

setSalary(32000)

setMonths(91)

setJobType("Janitor")

updateSalary(-.03)

- print out the object again to verify the information

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!