-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerson.java
100 lines (94 loc) · 2.38 KB
/
Person.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
//package com.project.courseManagement;
//importing library methods
import javax.swing.JOptionPane;
public abstract class Person {
//declaring variables
protected String nid;
protected String status;
protected String name;
protected String email;
protected String password;
//abstract methods
abstract void writeFile(String nid);
abstract void readFile(String nid);
abstract void changePassword(String nid);
//constructors
public Person() {
}
public Person(String nid, String status, String name, String email, String password) {
this.nid = nid;
this.status = status;
this.name = name;
this.email = email;
this.password = password;
}
//setter methods
public void setNid(String nid) {
this.nid = nid;
}
public void setStatus(String status) {
this.status = status;
}
public void setName(String name) {
this.name = name;
}
public void setEmail(String email) {
this.email = email;
}
public void setPassword(String password) {
this.password = password;
}
//getter methods
public String getNid() {
return nid;
}
public String getStatus() {
return status;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
//getting input for all components
public void inputNid() {
this.nid = JOptionPane.showInputDialog(null, "Enter NSU ID: ");
}
public void inputStatus() {
this.status = JOptionPane.showInputDialog(null, "Enter <1> for Student or <2> Teacher: ");
if(this.status.equals("1")) {
this.status = "Student";
}
else
this.status = "Teacher";
}
public void inputName() {
this.name = JOptionPane.showInputDialog(null, "Enter Full Name: ");
}
public void inputEmail() {
this.email = JOptionPane.showInputDialog(null, "Enter Your Email: ");
}
public void inputPassword() {
this.password = JOptionPane.showInputDialog(null, "Enter Password: ");
}
//setting print for all components
public void printNid() {
JOptionPane.showMessageDialog(null, "Your NSU ID: " + nid);
}
public void printStatus() {
JOptionPane.showMessageDialog(null, "Your are a: " + status);
}
public void printName() {
JOptionPane.showMessageDialog(null, "Full Name: " + name);
}
public void printEmail() {
JOptionPane.showMessageDialog(null, "Email Address: " + email);
}
public void printPassword() {
JOptionPane.showMessageDialog(null, "Your Password: " + password);
}
}