calculate students expectedClasses
This commit is contained in:
5 files changed
+10
-9
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user