/*** the appropriated headers are missing ***/ #include "student_struct.h" void fill_student(STUDENT *person) { fill_name(&(*person).name); /** printf("\nEnter major code - 4 digits only "); get_m_code(&(*person).mcode); **/ get_major_code((*person).major_code); get_year_school(&(*person).year_school); get_units_completed(&(*person).units_completed); get_grade_point(&(*person).grade_point); } void print_student(STUDENT person) { char temp[10]; printf("\nName: "); print_name_lastfirst(person.name); printf("\nMajor code: %s", person.major_code); printf("\nYear: "); print_year(person.year_school); printf("\nUnits Completed: %d", person.units_completed); printf("\nCurrent Grade Point: %f", person.grade_point); printf("\n"); } void get_m_code(int *code) { int error; do { error = 0; get_int_low(code, 0); if (*code >= 10000) { printf("\nError in major code - must be 4 digits only. Try again "); error = 1; } } while (error == 1); } void get_major_code(char code[]) { /** should do the error check to ensure that the 4 characters are actually digits in this subprogram **/ printf("\nEnter major code - 4 digits only "); my_gets(code, 4); } void get_year_school(int *year) { printf("\n1 - Freshman "); printf("\n2 - Sophomore "); printf("\n3 - Junior "); printf("\n4 - Senior "); printf("\n5 - Graduate Student "); printf("\nEnter your choice now "); get_int_bound(year, 1, 5); } void print_year(int year) { switch(year) { case 1: printf("Freshman"); break; case 2: printf("Sophomore"); break; case 3: printf("Junior"); break; case 4: printf("Senior"); break; case 5: printf("Granduate Student"); break; } } void get_units_completed(int *units) { printf("\nEnter number of units completed to date "); get_int_low(units, 0); } void get_grade_point(float *grade) { printf("\nEnter current grade point average "); get_float_bound(grade, 0.0, 4.0); } void swap_students(STUDENT *one, STUDENT *two) { STUDENT temp; temp = *one; *one = *two; *two = temp; } int compare_students_name(STUDENT one, STUDENT two) { return(compare_names(one.name, two.name)); }