/* Course Number : ISYS 116 Student Name : Jason Gradziel Student Number : 826-135-535 Professors Name : Gene Rychlewski Class Name : Thursday Lab Title : ISYS 103 */ #include #include #include #include /* Global Variables */ int grade[10]; int quiz, NUM_QUIZZES, choice; /* Function Prototypes */ /* Mainline functions */ getdata(); //setup(); process(); wrapup(); /* Subroutine functions */ bubble_sort(); printitle(); stats(); displaymenu(); /* Mainline */ main() { getdata(); //setup(); process(); wrapup(); return 0; } /* Subroutines */ getdata() { int flag2=1; while(flag2==1) { printitle(); gotoxy(20,5); printf("Enter in the number of tests (max 10)"); gotoxy(26,6); printf(": "); scanf("%d",&NUM_QUIZZES); if (NUM_QUIZZES > 10) { gotoxy(26,9); printf("Your choice is greater than 10! Enter again."); gotoxy(26,10); printf("Press any key to continue"); getch(); } else if (NUM_QUIZZES <= 0) { gotoxy(26,9); printf("Your choice is less than 1! Enter again."); gotoxy(26,10); printf("Press any key to continue"); getch(); } else flag2=0; } /* get the grades */ gotoxy(20,8); printf("Please enter %d integer quiz grades.", NUM_QUIZZES); for (quiz=0; quiz grade[quiz]) lowest = grade[quiz]; if (grade[quiz] > 59) passes++; } mean = totalmark/NUM_QUIZZES; /* displayes the quiz grades */ gotoxy(6,6); printf("The grades you entered are as follows:\n"); for (quiz=0; quiz grade[quiz+1]) { temp=grade[quiz]; grade[quiz] = grade[quiz+1]; grade[quiz+1]=temp; } --limit; } int flag1=1; while(flag1==1) { clrscr(); printitle(); gotoxy(10,5); printf("Do you want the sort to be displayed"); gotoxy(12,6); printf("in ascending or decending order?"); gotoxy(10,7); printf("For ascending press (1)"); gotoxy(10,8); printf("For decending press (2)"); gotoxy(45,6); scanf("%d",&order); if (order==1) { /* display the sorted quiz grades */ gotoxy(6,10); printf("The grades in ascending order are as follows:\n"); for (quiz=0; quiz=0; --quiz) { printf("%6d",grade[quiz]); } flag1=0; } else { gotoxy(10,11); printf("Incorrect number"); gotoxy(10,12); printf("Press any key to continue.."); getch(); } } gotoxy(1,20); printf("Press any key to continue.."); getch(); return 0; }