Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please code in java DataLoader.java: Employee.java: HourlyEmployee.java: PayrollReport.java: SalaryEmployee.java: Staff.java Temporary.java: You have been provided a partially completed program that parses a CSV data file
please code in java
DataLoader.java:
Employee.java:
HourlyEmployee.java:
PayrollReport.java:
SalaryEmployee.java:
Staff.java
Temporary.java:
You have been provided a partially completed program that parses a CSV data file (in DataLoader. java ) and creates Employee instances. However, the Employee class is empty. You will need to implement this class and any relevant subclass(es) to complete the program. - Identify the different dasses necessary to model each of the different types of employees in the problem statement. - Identify the relationship between these classes. - Identify the state (variables) that are common to these classes and the state that distinguishes them. Where do each of these pieces of data belong? - Identify the behavior (methods) that are common to each of these classes-what are methods that should be in the superclass? How should subclasses provide specialized behavior? - Some state/behavior may be common to several classes-is there an opportunity to define an intermediate class? - If you need more guidance, consult the UML diagram for one possible design. - To check your work, a text file containing the expected output has been provided in the project (see output/expectedoutput.txt ) Eclipse Tip: Many of the common programming tasks when dealing with objects can be automated by your IDE. For example: once you have designed the state (variables) of your class, you can automatically generate the boilerplate getters, setters, and constructors: when focused on your class, click "Source" then "Generate Getters and Setters" or "Generate Constructors using Fields." Java Note: In a subclass, you must invoke a constructor in the superclass and it must be done first. This rule is so that dasses conform to the is-a relationship. Invoking a super class's constructor is achieved by using the super keyword. If there are multiple constructors, you may invoke any one of them. Note that if a constructor does not explicitly invoke a superclass constructor, the Java compiler automatically inserts a call to the no-argument constructor of the superdass. If the superclass does not have a no-argument constructor, you will get a compile-time error. The Java object class has a no-arg constructor, so if your class does not explicitly extend a class, it implicitly 3.2 Abstractions Now that you have a well designed, functional implementation we will improve on the design by identifying potential abstractions that can be made. Start by making the Employee class abstract. If you had a good design, then nothing should break; the model did not have any generic employee. All employees were of a specific type. If something did break in your code, rethink your design and make the appropriate changes. Identify one or more methods in the Employee class that could be made abstract. Are there any methods in the superclass where it would not be appropriate to have a "default" definition? Make these methods abstract and again make any appropriate changes to your design as necessary. 3.3 Adding an Interface Cinco Corporation also has suppliers that they purchase supplies and parts from to build their products. Suppliers have a company name and an amount due, and so need to be paid, but they are not employees. However, the payroll department would like to have a common interface across all entities/objects in their system that are, in some way, payable. 1. Create an interface (in Eclipse: right click the package then "new" then "Interface") called Identify a single method in this interface that returns the (net) amount payable 2. Make the dass implement this new interface and make the appropriate changes if necessary 3. Create a new class, to represent suppliers and also make it 4. Testing, Submitting \& Grading - Test your programs using the provided JUnit test suite(s). Fix any errors and completely debug your programs. - Submit the following source files through webhandinStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started