/* Course Number : ISYS 116 Student Name : Jason Gradziel Student Number : 826-135-535 Professors Name : Gene Rychlewski Class Name : Thursday Lab Title : Table of Data With Hex From 0 - 255 */ #include #include #include /* Global Variables */ int total=0; /* Function Prototypes */ /* Mainline functions */ int setup(); int process(); int wrapup(); /* Subroutine functions */ /* Mainline */ void main(void) { setup(); process(); wrapup(); } /* Subroutines */ int setup() { /* print headers & output design */ clrscr(); printf(" Dec Hex Sym Dec Hex Sym Dec Hex Sym Dec Hex Sym Dec Hex Sym"); printf("\n"); for(int x=4; x<75; x++) { gotoxy(x,2); printf("Ä"); } for(x=4;x<81;x+=14) { for(int y=1;y<26;y++) { gotoxy(x,y); printf("³"); } } for(x=4;x<81;x+=14) { gotoxy(x,2); printf("Å"); } gotoxy(4,2); printf("Ã"); gotoxy(74,2); printf("´"); return 0; } int process() { /* nested for loop to print output for x - each coloumn dec - rows */ /* for the first page - 3 pages */ for (int x=0; x<60; x+=14) { for (int dec=0; dec<=22; dec++) { if (total!=7) { gotoxy(x+5,dec+3); printf(" %d %x %c",total,total,total); } /* if number printed is 7 then it prints it but not beep */ else { gotoxy(x+5,dec+3); printf(" %d %x Beep",total,total); } /* if number is 9 then it fixes the tab command and prints it */ if (total==9) { gotoxy(x+5,dec+3); printf(" %d %x TAB ³",total,total); } /* increment counter */ total+=1; } } /* for the second page */ getch(); setup(); for (x=0; x<60; x+=14) { for (int dec=0; dec<=22; dec++) { gotoxy(x+5,dec+3); printf(" %d %x %c",total,total,total); total+=1; } } /* for the third page */ getch(); setup(); /* prints first coloumn */ for (x=0; x<14; x+=14) { for (int dec=0; dec<=22; dec++) { gotoxy(x+5,dec+3); printf(" %d %x %c",total,total,total); total+=1; } } /* prints the last 3 numbers */ for (int dec=0; dec<=2; dec++) { gotoxy(19,dec+3); printf(" %d %x %c",total,total,total); total+=1; } return 0; } int wrapup() { /* pauses the screen - then prints message */ getch(); clrscr(); gotoxy(26,20); printf("Program complete"); /* clean up */ fflush(stdin); getch(); clrscr(); return 0; }