Code in JAVA and see attached images for information on classes and methods A company pays its personnel on a weekly basis. The personnel are of 4 types: FixedWeekly personnel are paid a fixed amount regardless of the number of hours worked ByTheHour personnel are paid by the hour and receive overtime pay for all hours worked in excess of 40 PercentOfSales personnel are paid a percentage of their sales FixedWeeklyPercentOfSales personnel receive a fixed amount plus a percentage of their sales. Create a class called Personnel. This class will represent the general concept of all personnel. All 4 types of personnel are considered Personnel. FixedWeeklyPercentOfSales personnel are considered to be PercentOfSales Personnel. The Personnel class will also be Payable. You will need to create the Payable interface. It will contain just one method called earnings(). Test Run Personnel processed polymorphically: FixedWeekly personnel: Harry Clark social security number: 111-11-1111 weekly salary: $800.00 earned $800.00 ByTheHour personnel: Katie Brown social security number: 222-22-2222 ByTheHour wage: $16.75; hours worked: 40.00 earned $670.00 PercentOfSales personnel: Joan White social security number: 333-33-3333 gross sales: $10,000.00; PercentOfSales rate: 0.06 earned $600.00 FixedWeeklyPercentOfSales personnel: Bob Green social security number: 444-44-4444
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Code in JAVA and see attached images for information on classes and methods
A company pays its personnel on a weekly basis. The personnel are of 4 types:
FixedWeekly personnel are paid a fixed amount regardless of the number of hours worked
ByTheHour personnel are paid by the hour and receive overtime pay for all hours worked in excess of 40
PercentOfSales personnel are paid a percentage of their sales
FixedWeeklyPercentOfSales personnel receive a fixed amount plus a percentage of their sales.
Create a class called Personnel. This class will represent the general concept of all personnel. All 4 types of personnel are considered Personnel. FixedWeeklyPercentOfSales personnel are considered to be PercentOfSales Personnel.
The Personnel class will also be Payable. You will need to create the Payable interface. It will contain just one method called earnings().
Test Run
Personnel processed polymorphically:
FixedWeekly personnel: Harry Clark
social security number: 111-11-1111
weekly salary: $800.00
earned $800.00
ByTheHour personnel: Katie Brown
social security number: 222-22-2222
ByTheHour wage: $16.75; hours worked: 40.00
earned $670.00
PercentOfSales personnel: Joan White
social security number: 333-33-3333
gross sales: $10,000.00; PercentOfSales rate: 0.06
earned $600.00
FixedWeeklyPercentOfSales personnel: Bob Green
social security number: 444-44-4444
gross sales: $5,000.00; PercentOfSales rate: 0.04; FixedWeekly salary: $300.00
new FixedWeekly salary with 10% increase is: $330.00
earned $530.00
Trending now
This is a popular solution!
Step by step
Solved in 6 steps
My output returns "D:\personnel.txt does not exist." instead of providing the proper test run. Is it not reading the file from readFile?