Answer to Question #242662 in Java | JSP | JSF for Aubrey Eso Jozela

Question #242662
Program 6 – Employee rules Code the following program in Java. Only submit the source files. There will be many source files. Do not zip your project as it increases the marking time significantly. As a programmer, you must be able to follow precise instructions. You will also not always get precise instructions. You must learn to ask questions and make valid deductions of what is expected. In this problem, you must think about the problem and ways to represent the rules in Java classes. The coding is very simple and a repeat if what you have done before. The class diagram for the bases classes are depicted in the following diagram. Problem discussion Some of the rules that govern employee behaviour are as follows:  Most employees work 37.5 hours per week.  Most employees earn R50 000 per year. Managers earn R20 000 extra per year.  Most employees get 15 workdays leaves a year. Managers get an extra 3 days leave per year.  Secretaries must work 40 per week.  Everybody must apply for leave online.
1
Expert's answer
2021-09-26T18:50:44-0400
class Employee{
    double hours;
    int salary;
    int leaves;
    
    public Employee(){
        hours=37.5;
        salary=50000;
        leaves=15;
    }
}
class Manager extends Employee{
    int leaves;
    int salary;
    public Manager(){
        leaves=18;
        salary=70000;
    }
}
class Secretary extends Employee{
    int hours;
    public Secretary(){
        hours=40;
    }
}
public class Main
{
	public static void main(String[] args) {
		Employee e;
		Manager m;
		Secretary s;
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS