Skip to content

Commit 8062532

Browse files
authored
Add files via upload
1 parent 4cb5351 commit 8062532

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
4+
5+
public class AEmployeeRecord extends BEmployeeSalary{
6+
7+
public void record(String empname, String empstat, String empded){
8+
System.out.println(" |---------------------------------|");
9+
System.out.println(" |Employee Name: " +empname);
10+
System.out.println(" |Employee Status: " + empstat);
11+
System.out.println(" |Department: " + empded);
12+
System.out.println(" |---------------------------------|");
13+
}
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public class BEmployeeSalary extends CemployeeDeduction{
2+
3+
public void salary(int prate, int hrswrked, int clothing, int transpo, int food){
4+
5+
int employeesalary =(prate * prate)+(clothing +transpo+ food);
6+
System.out.println(" |Employee Netpay: " +employeesalary);
7+
System.out.println(" |---------------------------------|");
8+
}
9+
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
public class CemployeeDeduction {
4+
5+
public void deductionsyow(int sssded, int loveded, int taxded){
6+
7+
int deducted= sssded+ loveded + taxded;
8+
System.out.println(" |Employee Deduction Overall: " + deducted);
9+
System.out.println(" |---------------------------------|");
10+
System.out.println(" |=================================|");
11+
System.out.println(" |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|");
12+
System.out.println(" |_________________________________|");
13+
}
14+
}

Inheritance Java/Main.java

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
3+
import java.util.Scanner;
4+
5+
6+
public class Main {
7+
8+
9+
public static void main(String[] args) {
10+
11+
Scanner pasok =new Scanner(System.in);
12+
System.out.println(" _____________________________");
13+
System.out.println(" |_____________________________|");
14+
System.out.println(" |------ G R O S S P A Y ------|");
15+
System.out.println(" |-----------------------------|");
16+
System.out.println(" | |");
17+
System.out.print (" |Employee Name: ");
18+
String empname =pasok.nextLine();
19+
System.out.print (" |Employee Status: ");
20+
String empstat =pasok.nextLine();
21+
System.out.print (" |Employee's Department: ");
22+
String empdep =pasok.nextLine();
23+
System.out.println(" |=============================|");
24+
System.out.print (" |Pay-Rate: ");
25+
int prate =pasok.nextInt();
26+
System.out.print (" |# of House Worked: ");
27+
int hrswrked =pasok.nextInt();
28+
System.out.print (" |Clothing Allowance: ");
29+
int clothing =pasok.nextInt();
30+
System.out.print (" |Transportation Allowance: ");
31+
int transpo =pasok.nextInt();
32+
System.out.print (" |Food Allowance: ");
33+
int food =pasok.nextInt();
34+
System.out.println(" |=============================|");
35+
System.out.print (" |SSS Deduction: ");
36+
int sssded =pasok.nextInt();
37+
System.out.print (" |Pag-Ibig Deduction: ");
38+
int loveded =pasok.nextInt();
39+
System.out.print (" |Tax Deduction: ");
40+
int taxded=pasok.nextInt();
41+
System.out.println(" |=============================|");
42+
System.out.println("");
43+
System.out.println(" _________________________________");
44+
System.out.println(" |_________________________________|");
45+
46+
47+
AEmployeeRecord Emprec =new AEmployeeRecord();
48+
49+
Emprec.record(empname, empstat, empdep);
50+
Emprec.salary(prate, hrswrked, clothing, transpo, food);
51+
Emprec.deductionsyow(sssded, loveded, taxded);
52+
53+
}}
54+
55+

0 commit comments

Comments
 (0)