-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteacher.java
More file actions
49 lines (44 loc) · 1.04 KB
/
teacher.java
File metadata and controls
49 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package school_management;
public class teacher {
private int id;
private String name;
private int salary;
private int salaryearned ;
/**
* salary for each teacher will be different based on different criterion
*
* @param id
* @param name
* @param salary
*/
public teacher(int id, String name,int salary){
this.id =id;
this.name= name;
this.salary= salary;
this.salaryearned =0;
}
/**
* returning the ids, name , salary for
* @return
*/
public int getId() {
return id;
}
public String getName(){
return this.name;
}
public int getSalary(){
return salary;
}
/**
* setting the salary of teacher
* @param salary
*/
public void setSalary(int salary){
this.salary = salary;
}
public void receivesalary(int salary){
salaryearned += salary;
mangementSystem.updateTotalMoneyspent(salary);
}
}