This repository has been archived by the owner on Mar 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProject.js
155 lines (119 loc) · 5.5 KB
/
Project.js
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
class Student {
constructor(studentID, name, major, unitsEnrolled, unitsWaitlisted) {
this.studentID = studentID;
this.name = name;
this.major = major;
this.unitsEnrolled = unitsEnrolled;
this.unitsWaitlisted = unitsWaitlisted;
}
get studentID() { return this.studentID; }
set studentID(studentID) { this.studentID = studentID; }
get name() { return this.name; }
set name(name) { this.name = name; }
get major() { return this.major; }
set major(major) { this.major = major; }
get unitsEnrolled() { return this.unitsEnrolled; }
set unitsEnrolled(unitsEnrolled) { this.unitsEnrolled = unitsEnrolled; }
get unitsWaitlisted() { return this.unitsWaitlisted; }
set unitsWaitlisted(unitsWaitlisted) { this.unitsWaitlisted = unitsWaitlisted; }
findCourse(courseNumber, title) {
return function listOfMatches() {return}
}
addToCart(sectionNumber, joinWaitlist, permissionNum) {
if((maxEnrollmentCapacity > capacity || permissionNum == correctPermissionNum()) && units <= maxUnits) {
return function sucessfullyAdded() {return}
} else if (maxEnrollmentCapacity <= capacity && joinWaitlist){
return function sucessfullyAddedWaitlist() {return}
}else {
return function errorFull(){return}
}
}
removeFromCart(sectionNumber){
return function sucessfullyRemoved() {return}
}
confirmCourse(){
return function confirmationEmail(CourseSection) {return}
}
}
class Course {
constructor(courseNumber, title, units) {
this.courseNumber = courseNumber;
this.title = title;
this.units = units;
}
get courseNumber() { return this.courseNumber; }
set courseNumber(courseNumber) { this.courseNumber = courseNumber; }
get title() { return this.title; }
set title(title) { this.title = title; }
get units() { return this.units; }
set units(units) { this.units = units; }
}
class CourseSection {
constructor(Course, sectionNumber, instructorName, startTime, endTime, meetingDays, roomNumber, numStudentsEnrolled, maxEnrollmentCapacity, numStudentsWaitlisted, maxWaitlistCapacity) {
this.Course = Course;
this.sectionNumber = sectionNumber;
this.instructorName = instructorName;
this.startTime = startTime;
this.endTime = endTime;
this.meetingDays = meetingDays;
this.roomNumber = roomNumber;
this.numStudentsEnrolled = numStudentsEnrolled;
this.maxEnrollmentCapacity = maxEnrollmentCapacity;
this.numStudentsWaitlisted = numStudentsWaitlisted;
this.maxWaitlistCapacity = maxWaitlistCapacity;
}
get Course() { return this.Course; }
set Course(Course) { this.Course = Course; }
get sectionNumber() { return this.sectionNumber; }
set sectionNumber(sectionNumber) { this.sectionNumber = sectionNumber; }
get instructorName() { return this.instructorName; }
set instructorName(instructorName) { this.instructorName = instructorName; }
get startTime() { return this.startTime; }
set startTime(startTime) { this.startTime = startTime; }
get endTime() { return this.endTime; }
set endTime(endTime) { this.endTime = endTime; }
get meetingDays() { return this.meetingDays; }
set meetingDays(meetingDays) { this.meetingDays = meetingDays; }
get roomNumber() { return this.roomNumber; }
set roomNumber(roomNumber) { this.roomNumber = roomNumber; }
get numStudentsEnrolled() { return this.numStudentsEnrolled; }
set numStudentsEnrolled(numStudentsEnrolled) { this.numStudentsEnrolled = numStudentsEnrolled; }
get maxEnrollmentCapacity() { return this.maxEnrollmentCapacity; }
set maxEnrollmentCapacity(maxEnrollmentCapacity) { this.maxEnrollmentCapacity = maxEnrollmentCapacity; }
get numStudentsWaitlisted() { return this.numStudentsWaitlisted; }
set numStudentsWaitlisted(numStudentsWaitlisted) { this.numStudentsWaitlisted = numStudentsWaitlisted; }
get maxWaitlistCapacity() { return this.maxWaitlistCapacity; }
set maxWaitlistCapacity(maxWaitlistCapacity) { this.maxWaitlistCapacity = maxWaitlistCapacity; }
}
class CourseEnrollment {
constructor(Course, CourseSection, Student, grade) {
this.Course = Course;
this.CourseSection = CourseSection;
this.Student = Student;
this.grade = grade;
}
get Course() { return this.Course; }
set Course(Course) { this.Course = Course; }
get CourseSection() { return this.CourseSection; }
set CourseSection(CourseSection) { this.CourseSection = CourseSection; }
get Student() { return this.Student; }
set Student(Student) { this.Student = Student; }
get grade() { return this.grade; }
set grade(grade) { this.grade = grade; }
}
class WaitlistedItem {
constructor(Course, CourseSection, Student, waitlistPosition) {
this.Course = Course;
this.CourseSection = CourseSection;
this.Student = Student;
this.waitlistPosition = waitlistPosition;
}
get Course() { return this.Course; }
set Course(Course) { this.Course = Course; }
get CourseSection() { return this.CourseSection; }
set CourseSection(CourseSection) { this.CourseSection = CourseSection; }
get Student() { return this.Student; }
set Student(Student) { this.Student = Student; }
get waitlistPosition() { return this.waitlistPosition; }
set waitlistPosition(waitlistPosition) { this.grade = waitlistPosition; }
}