-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudents.java
More file actions
134 lines (108 loc) · 3.52 KB
/
Copy pathStudents.java
File metadata and controls
134 lines (108 loc) · 3.52 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
public class Students {
public static void main(String[] args) {
//Assignment
//Create a class for Umat students
//Student should have a name, Year of birth, hometown, department,
// programme, year of study, hostel/hall, cwa, gender
//and should be able to change either password, department, cwa
Students Std1= new Students("Dan","male",2003, "Takoradi","Computer Science& Engineering",2, "KT Hall",85.0);
System.out.println(Std1.getName());
System.out.println(Std1.getGender());
System.out.println(Std1.getYear_of_birth());
System.out.println(Std1.getProgramme());
System.out.println(Std1.getHostel());
System.out.println(Std1.getCwa());
System.out.println(Std1.getYear_of_study());
Std1.setCwa(95.0);
System.out.println(Std1.getCwa());
Std1.setProgramme("Mathematics");
System.out.println(Std1.getProgramme());
}
/**
* This class represent Umat students
* Stores information such as name, gender, year of birth, hometown, department, year of study, hostel, cwa
*/
private String name;
private String gender;
private int year_of_birth;
private String hometown;
private String department;
private String programme;
private int year_of_study;
private String hostel;
private double cwa;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getYear_of_birth() {
return year_of_birth;
}
public void setYear_of_birth(int year_of_birth) {
this.year_of_birth = year_of_birth;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public int getYear_of_study() {
return year_of_study;
}
public void setYear_of_study(int year_of_study) {
this.year_of_study = year_of_study;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public double getCwa() {
return cwa;
}
public void setCwa(double cwa) {
this.cwa = cwa;
}
public String getHostel() {
return hostel;
}
public void setHostel(String hostel) {
this.hostel = hostel;
}
public String getProgramme() {
return programme;
}
public void setProgramme(String programme) {
this.programme = programme;
}
public String getHometown() {
return hometown;
}
public void setHometown(String hometown) {
this.hometown = hometown;
}
public Students(String name, String gender, int year_of_birth, String hometown, String programme,
int year_of_study, String hostel, double cwa ){
this.name= name;
this.gender= gender;
this.year_of_birth=year_of_birth;
this.department= department;
this.programme=programme;
this.year_of_study= year_of_study;
this.hostel= hostel;
this.cwa= cwa;
}
public String toString(){
return "Students: "+
"name'" +name + "\'"+ ", gender" + gender+ "\'"+
"year_of_birth'" +year_of_birth + "\'" +
"department'" +department +"\'" +
"programme'" +programme + "\'" +
"year_of_study'" + "\'" +
"hostel'" +hostel +"\'" +
"cwa'" +cwa +"\'";}
}