/* Course Number : ISYS 116 Student Name : Jason Gradziel Student Number : 826-135-535 Professors Name : Gene Rychlewski Class Name : Thursday Lab Title : EDUCOST */ #include #include #include void setup(void); void process(void); void wrapup(void); int semesters, costs, total; void main(void) { setup(); process(); wrapup(); } void setup(void) { /* Title Screen */ clrscr(); printf("\n\n\n\n\n\n\n\n\t\t\tTHE COST OF EDUCATION:"); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\nPress any key to continue."); getch(); /* Semester Input */ int flag=1; while(flag==1) { clrscr(); printf("\n\n\n\n\n\t\tHow many semesters will it take"); printf("\n\t\tyou to get your diploma ?: "); scanf("%d",&semesters); if (semesters > 7) { printf("\n\t\tThere is no program at Humber"); printf("\n\t\tgreater than seven semesters."); } else if (semesters < 1) { printf("\n\t\tYou have to be here at least one semester."); } else flag = 0; printf("\n\t\tPress any key to continue."); getch(); } /* Costs Input */ flag = 1; while(flag == 1) { clrscr(); printf("\n\n\n\n\n\t\tHow much will it cost (estimate)"); printf("\n\t\tfor each semester ?: $"); scanf("%d", &costs); if (costs < 1) { printf("\n\t\tYour education cost some money,"); printf("\n\t\teven if you didn't pay for it."); } else if (costs > 10000) { printf("\n\t\tAre you sure it will cost $%d",costs); printf("\n\t\tfor each semester?"); } else flag=0; printf("\n\t\tPress any key to continue."); getch(); } } void process(void) { total = semesters * costs; } void wrapup(void) { clrscr(); printf("\n\n\n\n\n\t\tYou will spend $%d for your education here.",total); if (total > 10000) printf("\n\n\t\tYou better find a job quickly."); else printf("\n\n\t\tYou are getting a real bargain."); getche(); }