/* Course Number : ISYS 116 Student Name : Jason Gradziel Student Number : 826-135-535 Professors Name : Gene Rychlewski Class Name : Thursday Lab Title : GPA2 */ #include #include #include #include /* Global Variables */ char fname[16], lname[21], snum[12], //= "___-___-___", ccode[9]; int numsubjt, mark, credits, wmark, num, flag=1; double total, totalcrdt, GPA; /* Function Prototypes */ /* Mainline functions */ int setup(); int process(); int wrapup(); /* Subroutine functions */ void title(); void getnumsubjects(); void prtheaders(); void prtnumsubjects(); void prttotal(); void getinput(); void calcs(); void final(); void prtGPAmsg(); void getyesno(); /* Mainline */ void main(void) { while (flag==1) { total=0; totalcrdt=0; GPA=0; for (int a=0; a<11; a++) snum[a]= ' '; setup(); process(); wrapup(); getyesno(); } /* clean up */ fflush(stdin); //getch(); clrscr(); } /* Subroutines */ int setup() { fflush(stdin); title(); getnumsubjects(); prtheaders(); prtnumsubjects(); return 0; } int process() { for(num=0; num 7) numsubjt = 7; } void prtheaders() { clrscr(); title(); gotoxy(30,6); printf("%s %s %s",fname,lname,snum); gotoxy(10,10); printf("#"); gotoxy(15,9); printf("Course"); gotoxy(16,10); printf("Code"); gotoxy(30,10); printf("Mark"); gotoxy(40,10); printf("Credits"); gotoxy(50,9); printf("Weighted"); gotoxy(51,10); printf("Mark"); gotoxy(10,11); printf("="); gotoxy(15,11); printf("======"); gotoxy(30,11); printf("===="); gotoxy(40,11); printf("======="); gotoxy(51,11); printf("===="); } void prtnumsubjects() { for (num=0; num 79) { gotoxy(25,num+16); printf("Congratulations!...You have Honours!"); } else { gotoxy(25,num+16); printf("Passing!...Keep up the good work."); } } void getyesno() { int flag2=1; while (flag2==1) { char quit,y,Y,n,N; printf("\n\n\tDo you want to quit?(Y/N) "); quit=getch(); if (quit == 'Y' || quit == 'y') { printf("\n\tBye Bye!"); flag = 0; flag2=0; delay(500); //getch(); } else if (quit == 'N' || quit == 'n') { printf("\n\tO.K."); delay(500); flag2=0; //getch(); } else { printf("\n\tThat is incorrect."); delay(500); //getch(); } } }