-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAdmin.java
120 lines (93 loc) · 2.68 KB
/
Admin.java
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package RestaurantManagementSystem;
public class Admin implements info {
private String name;
private int id;
private String mail;
Admin(String name, int id, String mail) {
this.name = name;
this.id = id;
this.mail = mail;
}
private boolean account_validity = true;
boolean AccountValidity() {
return account_validity;
}
void DeleteAccount() {
account_validity = false;
}
@Override
public void DisplayInfo() {
System.out.println("\nName : " + name);
System.out.println("ID : " + id);
System.out.println("Mail : " + mail);
}
@Override
public void setMail(String mail) {
this.mail = mail;
}
@Override
public String getMAil() {
return mail;
}
}
class JuniorAdmin extends Admin {
private int salary = 80000;
JuniorAdmin(String name, int id, String mail) {
super(name, id, mail);
}
@Override
public void DisplayInfo() {
if (AccountValidity() == true) {
super.DisplayInfo();
System.out.println("Salary : " + salary + " Taka");
} else {
System.out.println("\nSorry, Account not found!");
}
}
public void CheckInfo(Employee the_employee) {
the_employee.DisplayInfo();
}
// Overload
public void CheckInfo(FoodCooker the_cooker) {
the_cooker.displayInfo();
}
// Overload
public void CheckInfo(Customer the_customer) {
the_customer.DisplayInfo();
}
// Overload
public void CheckInfo(Hotel the_hotel) {
the_hotel.DisplayInfo();
}
// Overload
public void CheckInfo(Food the_food) {
the_food.DisplayInfo();
}
}
class SeniorAdmin extends Admin {
private int salary = 90000;
SeniorAdmin(String name, int id, String mail) {
super(name, id, mail);
}
@Override
public void DisplayInfo() {
if (AccountValidity() == true) {
super.DisplayInfo();
System.out.println("Salary : " + salary + " Taka");
} else {
System.out.println("\nSorry, Account not found!");
}
}
public void DeleteEmployeeAccount(Employee the_Employee) {
the_Employee.DeleteAccount();
System.out.println("\nSuccessfully delete an employee account!");
}
public void DeleteCookerAccount(FoodCooker the_cooker) {
the_cooker.DeleteAccount();
System.out.println("\nSuccessfully delete a cooker account!");
}
public void DeleteCustomerAccount(Customer the_customer) {
the_customer.DeleteAccount();
System.out.println("\nSuccessfully delete a customer account!");
}
}