void display_info(Course courses[], Student students[], int courses_actual, int students_actual) { int choice; do { choice = get_choice(); switch (choice) { case 0: break; case 1: find_CRN(courses, students, courses_actual, students_actual); break; case 2: find_subject(courses, courses_actual); break; case 3: add_course(courses, students, courses_actual, students_actual); break; case 4: remove_course(students, students_actual); break; default: printf("Your choice is outside the acceptable range. " "Please try again.\n"); } // switch (choice) } while (choice != 0); } // display_info()
void readCourse(course_node *courseList, char *s) { int course_number; int semester_number; char *course_name = malloc(sizeof(char)*limit); if (sscanf(s, "C %d %s %d", &course_number, course_name, &semester_number) > 0) { course *newCourse = create_course(course_number, course_name, semester_number); add_course(courseList, newCourse); } }
void get_teacher_courses_recursive(assignment_node *assignmentList, teacher *myTeacher, course_node *myCoursList) { if (assignmentList != NULL) { if (assignmentList->current != NULL) { if (assignmentList->current->a_teacher->teacher_number == myTeacher->teacher_number) { add_course(myCoursList, assignmentList->current->a_course); } } } if (assignmentList->next != NULL) { get_students_courses_recursive(assignmentList->next, myTeacher, myCoursList); } }
void get_students_courses_recursive(enrollment_node *enrollmentList, student *myStudent, course_node *myCoursList) { if (enrollmentList != NULL) { if (enrollmentList->current != NULL) { if (enrollmentList->current->e_student->student_number == myStudent->student_number) { add_course(myCoursList, enrollmentList->current->e_course); } } } if (enrollmentList->next != NULL) { get_students_courses_recursive(enrollmentList->next, myStudent, myCoursList); } }