-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCourse.java
More file actions
32 lines (29 loc) · 884 Bytes
/
Course.java
File metadata and controls
32 lines (29 loc) · 884 Bytes
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
public class Course {
Teacher courseTeacher;
String name ;
String code;
String prefix;
String teacher;
int note;
Course(String name,String code,String prefix){
this.code=code;
this.name=name;
this.prefix=prefix;
this.note=0;
}
public void addTeacher( Teacher t){
if (this.prefix.equals(t.branch)) {
this.courseTeacher = t;
System.out.println("İşlem başarılı");
} else {
System.out.println(t.name + " Akademisyeni bu dersi veremez.");
}
}
public void printTeacher() {
if (courseTeacher != null) {
System.out.println(this.name + " dersinin Akademisyeni : " + courseTeacher.name);
} else {
System.out.println(this.name + " dersine Akademisyen atanmamıştır.");
}
}
}