-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclasses.py
46 lines (37 loc) · 1.26 KB
/
classes.py
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
class classes:
# Creates classes that students will take
# Name: Name of the Class, could be seperated into 'name, difficulty'
# Times: Available times of the class
# Capacity: How many students can take the class
def __init__(self, ty, times, capacity, level, teacher):
self.__ty = ty
self.__time = times
self.__cap = capacity
self.__current_students = 0
self.__level = level
self.__teacher = teacher
# Checks if the classs is at capacity
def is_full(self):
if self.__current_students == self.__cap:
return True
else:
return False
# adds a student to the class
# eventually this could keep track of which students if desired
# raises index error if class is at capacity
# TODO: correct Error type, with handling
def add_student(self):
if self.is_full():
return IndexError
else:
self.__current_students += 1
def set_teacher(self,teacher):
self.__teacher = teacher
def get_teacher(self):
return self.__teacher
def get_time(self):
return self.__time
def get_level(self):
return self.__level
def get_type(self):
return self.__ty