-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourse.java
55 lines (54 loc) · 1.45 KB
/
Course.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
public class Course {
private String CID="";
private String Name="";
private String Teacher;
private int Capacity;
public Course() {}
public Course(String _cid,String _name,String _teacher,int _capacity) {
this.CID=_cid;
this.Name=_name;
this.Teacher=_teacher;
this.Capacity=_capacity;
}
public static String toString(Course x) {
if(x.getCID()==null) {
System.out.println("Course does not exist.");
return null;
}
System.out.print("CID:"+x.getCID()+",");
System.out.print("Name:"+x.getName()+",");
/*System.out.print("[");
for(int i=0;i<_teacher.length-1;i++) {
System.out.print(_teacher[i]+",");
}
System.out.print(_teacher[_teacher.length-1]+"],");*/
System.out.print("Teacher:"+x.getTeacher()+",");
System.out.print("Capacity:"+x.getCapacity());
System.out.println();
return null;
}
public void setCID(String _cid) {
this.CID=_cid;
}
public String getCID() {
return CID;
}
public void setName(String _name) {
this.Name=_name;
}
public String getName() {
return Name;
}
public void setTeacher(String _teacher) {
this.Teacher=_teacher;
}
public String getTeacher() {
return Teacher;
}
public void setCapacity(int _capacity) {
this.Capacity=_capacity;
}
public int getCapacity() {
return Capacity;
}
}