calculate students expectedClasses

This commit is contained in:
SowinskiBraeden committed 2024-10-20 11:03:40 -07:00
1 parent 3628f0447c
commit 30de648948
5 files changed
+10 -9

No files matched your search

-2
View File
@@ -24,6 +24,4 @@ typedef enum {
TIMETABLE generateTimetable(STUDENT *students, size_t size_students, COURSE *courses, size_t size_courses);
bool isFlex(char crsNo[MAX_COURSE_NO_LEN]);
#endif
+2
View File
@@ -35,4 +35,6 @@ static const char FLEX[][11] = {"XAT--12A-S", "XAT--12B-S"};
void handle(void* mem, char name[]);
bool isFlex(char crsNo[MAX_COURSE_NO_LEN]);
#endif
-7
View File
@@ -10,13 +10,6 @@
const char hex[] = "0123456789abcdefABCDEF";
// May be needed later
bool isFlex(char crsNo[MAX_COURSE_NO_LEN]) {
for (uint8_t i = 0; i < sizeof(FLEX)/sizeof(FLEX[0]); i++)
if (strcmp(crsNo, FLEX[i]) == 0) return true;
return false;
}
void appendChar(char *str, char ch) {
int len = strlen(str);
str[len] = ch;
+6
View File
@@ -18,6 +18,12 @@ void handle(void *mem, char name[]) {
}
}
bool isFlex(char crsNo[MAX_COURSE_NO_LEN]) {
for (uint8_t i = 0; i < sizeof(FLEX)/sizeof(FLEX[0]); i++)
if (strcmp(crsNo, FLEX[i]) == 0) return true;
return false;
}
int main(int argc, char *argv[]) {
/*
read csv data into array of structs that can
+2
View File
@@ -75,6 +75,8 @@ STUDENT *getStudents(CSV_LINE *lines, size_t lines_len, int total_blocks, UNIQUE
request.alternate = lines[i].alternate;
students[j].requests[students[j].requestsLen] = request;
students[j].requestsLen++;
if (!isFlex(request.crsNo) && !request.alternate && students[j].expectedClasses < TOTAL_BLOCKS)
students[j].expectedClasses++;
break;
}
}