forked from PrabashanaDev/bci-test-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcourse.py
More file actions
65 lines (46 loc) · 1.57 KB
/
course.py
File metadata and controls
65 lines (46 loc) · 1.57 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
from abc import ABC, abstractmethod
class Course(ABC):
def __init__(self):
self.courID = ""
self.courName = ""
def setCourse(self, courID, courName):
self.courID = courID
self.courName = courName
@abstractmethod
def calAvg(self):
pass
class BciDegree(Course):
def __init__(self, courID, courName):
super().__init__()
self.setCourse(courID, courName)
def showCourse(self):
print(f"Course ID: {self.courID}, Course Name: {self.courName}")
def calAvg(self, marks):
return marks
class BciDiploma(Course):
def __init__(self, courID, courName):
super().__init__()
self.setCourse(courID, courName)
def showCourse(self):
print(f"Course ID: {self.courID}, Course Name: {self.courName}")
def calAvg(self, marks):
return marks
class BciCertificate(Course):
def __init__(self, courID, courName):
super().__init__()
self.setCourse(courID, courName)
def showCourse(self):
print(f"Course ID: {self.courID}, Course Name: {self.courName}")
def calAvg(self, marks):
return marks
if __name__ == "__main__":
course1 = BciDegree("001", "(BSIT) Information Technology")
course1.showCourse()
course2 = BciDegree("002", "(BSSE) Software Engineering")
course2.showCourse()
course3 = BciDegree("003", "(BMS) Business Management")
course3.showCourse()
course4 = BciDiploma("004", "Aquinas English")
course4.showCourse()
course5 = BciCertificate("005", "Robotics")
course5.showCourse()