// program for TM 0045 - OCT 1999 #include #include #include #include #include #include #include #include #define N 100 /* Definasi istihar fungsi */ void buka_fail_pelajar ( void ); void buka_fail_gred( void ); void buka_fail_bilang ( void ); void simpan_fail( void ); void simpan_gred ( void ); void simpan_bilang ( void ); void input_pelajar ( void ); void input_gred(void); void konfigurasi_gred (void); void update_markah(void); int menu_utama ( void ); int menu_kemaskini ( void ); int menu_papar(void); void menu_papar_pel( void ); int menu_papar_gred(void); int menu_gred ( void ); int menu_kemas_gred ( void ); int menu_tambah_pelajar (void); void papar_one_pelajar ( int i ); void papar_semua_pelajar(void); void papar_pilih_gred ( void ); void papar_gred ( int i ); void papar_semua_gred(void); void kemaskini_pelajar ( void ); void kemas_gred ( void ); void cari_pelajar ( void ); void cari_gred ( void ); void hapus_pelajar ( void ); void hapus_gred ( void ); void ralat ( void ); void ralat2 (void); void bilang (void) ; void tolongAna (void); void Scroll(); /* Istihar struktur data gred dan mata kredit */ struct mr_kredit { char gred[4]; char kredit[5]; }; /* Istihar struktur tarikh */ struct tarikh { char hari[3]; char bulan[3]; char tahun[5]; }t [N]; /* Istihar struktur ahli untuk sistem gred */ struct gred { char markahA[4]; char markahB[4]; struct mr_kredit mk; struct tarikh tkh; } ahli[12]; /* Istihar struktur rekod pelajar */ struct rekod { char matapelajaran[22]; char markah[5]; char gred[3]; char kredit[13]; struct tarikh tk; }rekod[N]; /* Istihar struktur data keseluruhan data pelajar */ struct data_pelajar { char nama[40]; char metrik[15]; char bil[3]; struct rekod rd; } pelajar[N]; /* Istihar struktur bilang gred*/ struct bilang { char bil[3]; char grd[3]; char BilSemua[4]; struct tarikh tk; }bill[15]; char KotakPelajar[22][83]= {"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»", "º º", "ÇÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄĶ", "ºBIL³ NO.MATRIK ³ MATAPELAJARAN ³MARKAH³GRED³MATA GRED³TARIKH INPUTº", "ÇÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄĶ", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º", "º ³ ³ ³ ³ ³ ³ º"}; char kotakGred[20][62]= {"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»", "º º", "ÌÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍ͹", "º BIL ³ GRED ³ DARI MARKAH ³ HINGGA MARKAH ³ MATA GRED º", "ÇÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄĶ", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "º ³ ³ ³ ³ º", "ÈÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍͼ"}; char kotakPapar[19][56]= {"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»", "º º", "ÌÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍ͹", "º GRED ³ DARI MARKAH ³ HINGGA MARKAH ³ MATA GRED º", "ÇÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄĶ", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "º ³ ³ ³ º", "ÈÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍͼ"}; char Kotak_bilGred[20][42]= {"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»", "º º", "ÌÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹", "º GRED ³ BILANGAN PELAJAR º", "ÇÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ", "º A ³ º", "º A- ³ º", "º B+ ³ º", "º B ³ º", "º B- ³ º", "º C+ ³ º", "º C ³ º", "º C- ³ º", "º D+ ³ º", "º D ³ º", "º D- ³ º", "º E ³ º", "ÈÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"}; char kotakInput[14][51]= {" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ", " ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ", " ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ ", " º º ", " º º ", " º º ", " º º ", " º º ", " º º ", " º º ", " º º ", " ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "}; char MenuUtama[19][80]= {"ÛÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛÛ", "ºº ºº", "ºÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹º", "ºº º ºº", "ºº [1] INPUT DATA PELAJAR º [5] PAPAR KEPUTUSAN PELAJAR ºº", "ºº º ºº", "ºº [2] MENCARI DATA PELAJAR º [6] BILANGAN PELAJAR & GRED ºº", "ºº º ºº", "ºº [3] KEMASKINI DATA PELAJAR º [7] KONFIGURASI GRED ºº", "ºº º ºº", "ºº [4] HAPUS DATA PELAJAR º [8] UPDATE GRED DAN TARIKH ºº", "ºº º ºº", "ºÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹º", "ºº [9] ºº", "ºº K E L U A R ºº", "ÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÛ"}; int i, j; int akhir = 0; int akhir1 = 0; int akhir2 = 0; int markah, markahAwal, markahAkhir; char hari_d[3], bulan_m[3], tahun_y[5]; FILE *stream; char *p; char* input(int len) { char buffer[83]; /* There's space for 80 characters plus the NULL terminator */ buffer[0] = len; textcolor(10); return cgets(buffer); } int file_exists(char *filename) { return (access(filename, 0) == 0); } long filesize(FILE *stream) { long curpos, panjang; curpos = ftell(stream); fseek(stream, 0L, SEEK_END); panjang = ftell(stream); fseek(stream, curpos, SEEK_SET); return panjang; } /* fungsi 'jam' */ void Jam (void) { do{ textcolor(YELLOW); struct date d; getdate(&d); struct time t; gettime(&t); gotoxy(30,2); cprintf("[ %2d:%2d:%2d ",t.ti_hour,t.ti_min,t.ti_sec); cprintf("%2d/%2d/%4d ]",d.da_day,d.da_mon,d.da_year); delay(100); _setcursortype(_NOCURSOR); }while(!kbhit()); _setcursortype(_NORMALCURSOR); }/* tamat fungsi masa */ /* fungsi 'memeriksa" : melihat bait fail dan kewujudan fail */ void periksa(void){ textmode(BW80);// Mode skrin hitam-putih clrscr(); stream = fopen("a:pelajar.dat", "r"); gotoxy (25,10);cprintf("pelajar.dat: %ld bytes %s ", filesize(stream), file_exists("a:pelajar.dat") ? "access" : "NO"); delay(2000); stream = fopen("a:gred.dat", "r"); gotoxy (25,13);cprintf("gred.dat: %ld bytes %s ", filesize(stream), file_exists("a:gred.dat") ? "access" : "NO"); delay(2000); stream = fopen("a:bilang.dat", "r"); gotoxy (25,16);cprintf("bilang.dat: %ld bytes %s ", filesize(stream), file_exists("a:bilang.dat") ? "access" : "NO"); delay(2000); fclose(stream); } /* tamat fungsi ' peirksa ' */ /* fungsi 'tarikh': menulis tarikh ke dalam fail bilang.dat apabila aturcara di buka */ void tarikh (void) { i=0; clrscr(); struct date d; getdate(&d); itoa(d.da_day, hari_d,10); itoa(d.da_mon, bulan_m, 10); itoa(d.da_year, tahun_y, 10); strcpy(bill[i].tk.hari ,hari_d); strcpy(bill[i].tk.bulan ,bulan_m); strcpy(bill[i].tk.tahun ,tahun_y); simpan_bilang(); /* memanggil fungsi 'simpan_bilang' */ } /* tamat fungsi 'tarikh */ /*****************************/ /* Aturcara Utama */ /*****************************/ // Aturcara bermula di sini ... void main(void){ int khuz; textmode(BW80);// Mode skrin hitam-putih buka_fail_pelajar(); /* buka fail pelajar */ buka_fail_gred(); /* buka fail gred */ buka_fail_bilang();/*buka fail bilangan */ tarikh(); /* memanggil fungsi 'tarikh' */ clrscr(); do { khuz = menu_utama(); /* memanggil fungsi 'menu_utama' */ switch (khuz) { case 1 : fflush(stdin);input_pelajar(); /* memanggil fungsi 'input_pelajar' */ break; case 2 : fflush(stdin);cari_pelajar(); /* memanggil fungsi 'cari_pelajar' */ break; case 3 : fflush(stdin);kemaskini_pelajar(); /* memanggil fungsi 'kemaskini_pelajar' */ break; case 4 : fflush(stdin);hapus_pelajar(); /* memanggil fungsi 'hapus_pelajar' */ break; case 5 : fflush(stdin);menu_papar_pel(); /* memanggil fungsi 'menu_papar_pel' */ break; case 6 : fflush(stdin);bilang(); /* memanggil fungsi 'bilang' */ break; case 7 : fflush(stdin);konfigurasi_gred(); /* memanggil fungsi 'konfigurasi_gred' */ break; case 8 : fflush(stdin);update_markah(); /* memanggil fungsi 'update_markah' */ break; case 9 : Scroll(); /* memanggil fungsi 'Scroll' */ break; } /* penutup switch */ } while (khuz != 9); } /* penutup main */ /* Pengujian ke atas fail data */ void buka_fail_pelajar ( void ) { FILE *fpt; if((fpt = fopen("a:PELAJAR.DAT","r")) == NULL ) { /* menguji samada fail */ gotoxy(24,12);printf(" Fail PELAJAR.DAT tiada "); /* dapat dibuka atau tidak */ sound(861); delay(1000); nosound(); delay(2000); gotoxy(24,12);printf(" continue.......to create "); /* dapat dibuka atau tidak */ delay(1000); return; } if( fread( &akhir, sizeof akhir, 1, fpt) != 1) { gotoxy(20,12);printf("Pengujian pengiraan data PELAJAR.DAT rosak ");/* menguji samada data */ sound(861); delay(1000); nosound(); /* dapat dibaca dari fail */ getch(); exit(1); } if( fread( &pelajar, sizeof pelajar, 1, fpt) != 1) { gotoxy(20,12);printf("Data PELAJAR.DAT tidak dapat dibaca\n");/* membaca samada data */ sound(861); delay(1000); nosound(); /* dapat dibaca dari fail */ getch(); exit(1); } fclose(fpt); } /* tamat fungsi buka_ fail_pelajar */ /****************************************/ /* Modul menu_utama */ /****************************************/ // Modul ini memaparkan menu utama untuk di pilih int menu_utama ( void ) { char a[3]; int khuz, x, g; clrscr(); do { textcolor(2); for(g = 0; g < 17; g++) { textbackground(9); gotoxy(6,6+g);cprintf("%s",MenuUtama[g]); } /* penutup for g */ textcolor(5); gotoxy(32,7); cprintf("M E N U U T A M A"); textcolor(13+BLINK); gotoxy(9,10);cprintf("[1]"); gotoxy(9,12);cprintf("[2]"); gotoxy(9,14);cprintf("[3]"); gotoxy(9,16);cprintf("[4]"); gotoxy(43,10);cprintf("[5]"); gotoxy(43,12);cprintf("[6]"); gotoxy(43,14);cprintf("[7]"); gotoxy(43,16);cprintf("[8]"); gotoxy(40,19);cprintf("[9]"); textbackground(0); textcolor(12); gotoxy(25,22);cprintf("Sila masukkan pilihan anda *> [ ]"); textcolor(7); Jam(); a[0]=2; gotoxy(56,22); p=cgets(a); khuz = atoi(p); if ( khuz < 1 || khuz > 9 ) { ralat2 (); /* panggilan fungsi ralat2 */ } } while ( khuz < 1 || khuz > 9 ); textcolor(7); return (khuz); } /* tamat menu utama */ /* fungsi 'menu_tambah_pelajar': menu input pilihan data pelajar */ int menu_tambah_pelajar (void) { char n[3]; int tambah, d; clrscr(); do{ clrscr(); for(d = 0; d < 14; d++) { textcolor(12); gotoxy(17,7+d);cprintf("%s",kotakInput[d]); } /* pentup for d */ textcolor(10); gotoxy(29,8); cprintf(" MENU INPUT DATA PELAJAR "); gotoxy(22,11); cprintf(" 1 þ TAMBAH DATA BARU " ); gotoxy(22,13); cprintf(" 2 þ INPUT DATA BARU & HAPUS DATA LAMA "); gotoxy(22,15); cprintf(" 3 þ KEMBALI KE MENU UTAMA "); gotoxy(26,18); cprintf(" MASUKKAN PILIHAN ANDA *> [ ]"); n[0] = 2; gotoxy(53,18); p = cgets(n); tambah = atoi(p); if ( tambah < 1 || tambah > 3 ) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while ( tambah < 1 || tambah > 3 ); return tambah; } /* tamat fungsi 'tambah' */ /* Fungsi input/masuk data */ void input_pelajar ( void ) { int n, q; int bil=0; int k1, k2, key; if((stream = fopen("a:gred.dat","r")) == NULL ) { /* menguji samada fail dapat dibuka atau tidak */ sound(861); delay(1000); nosound(); clrscr(); _setcursortype(_NOCURSOR); textcolor(4+BLINK); gotoxy(24,12);cprintf(" Fail gred.dat tiada "); textcolor(YELLOW); sound(861); delay(2500); nosound(); gotoxy(24,14);cprintf("Tekan untuk pergi ke informasi "); textcolor(7); getch(); tolongAna(); /* memanggil fungsi 'tolongAna' */ } /* penutp if */ n=menu_tambah_pelajar(); /* memanggil fungsi pilihan input */ if (n == 1) i = akhir; else if (n == 2) i = 0; else return; clrscr(); for ( i; i < N; i++ ) { textbackground(0); textcolor(13); gotoxy(15,2); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(15,3); cprintf(" º Sistem Masukan Data Pelajar º "); gotoxy(15,4); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); textcolor(10); _setcursortype(_SOLIDCURSOR); gotoxy(10,7); cprintf("NAMA : "); gotoxy(10,9); cprintf("NOMBOR MATRIK : "); gotoxy(10,11); cprintf("MATAPELAJARAN : "); gotoxy(10,13); cprintf("MARKAH : "); gotoxy(10,15); cprintf("GRED : "); gotoxy(10,17); cprintf("MATA GRED : "); gotoxy(10,19); cprintf("TARIKH MARKAH INI DI REKODKAN : / / "); textcolor(1); window(10,23,80,10); textbackground(5); gotoxy(41,7); cprintf("[ ]"); gotoxy(41,9); cprintf("[ ]"); gotoxy(41,11); cprintf("[ ]"); gotoxy(41,13); cprintf("[ ]"); textbackground(0); textcolor(7); gotoxy(35,23);cprintf("Bil : %d", bil); textcolor(1); textbackground(5); gotoxy(42,7);strcpy(pelajar[i].nama,input(37)); textcolor(7); textbackground(0); gotoxy(3,25); cprintf(" "); if ( !*pelajar[i].nama ) { gotoxy(3,25);;cprintf("Sistem keluar ke menu utama"); break; } /* penutup if untuk break */ textcolor(1); textbackground(5); gotoxy(42,9);strcpy(pelajar[i].metrik,input(14)); gotoxy(42,11);strcpy(pelajar[i].rd.matapelajaran,input(20)); gotoxy(42,13);strcpy(pelajar[i].rd.markah,input(4)); for (j=0; j=markahAwal) && (markah<=markahAkhir) && (ahli[j].markahA !=NULL && ahli[j].markahA !=NULL)) { strcpy(pelajar[i].rd.gred, ahli[j].mk.gred); strcpy(pelajar[i].rd.kredit, ahli[j].mk.kredit); textbackground(GREEN); gotoxy(41,15); cprintf("%s", ahli[j].mk.gred); gotoxy(41,17); cprintf("%s", ahli[j].mk.kredit); textbackground(0); } /* tutup if */ } /* penutup for j */ textcolor(1); struct date d; getdate(&d); itoa(d.da_day, hari_d,10); itoa(d.da_mon, bulan_m, 10); itoa(d.da_year, tahun_y, 10); strcpy(pelajar[i].rd.tk.hari ,hari_d); strcpy(pelajar[i].rd.tk.bulan ,bulan_m); strcpy(pelajar[i].rd.tk.tahun ,tahun_y); textbackground(GREEN); gotoxy(41,19); cprintf("%s/%s/%s",pelajar[i].rd.tk.hari, pelajar[i].rd.tk.bulan,pelajar[i].rd.tk.tahun); textbackground(0); textcolor(7); bil++; textbackground(0); gotoxy(3,25); cprintf("tekan jika hendak berhenti ATAU teruskan input"); delay(1500); clrscr(); } /* penutup for i*/ _setcursortype(_NOCURSOR); akhir = i; akhir1 = j; simpan_fail(); return; } /* tamat fungsi input_pelajar */ /* Fungsi simpan_fail :Menulis data ke dalam fail data */ void simpan_fail ( void ) { FILE *fpt; if (( fpt = fopen ("a:PELAJAR.DAT","w")) == NULL) { gotoxy(24,12);printf(" Fail PELAJAR.DAT tiada "); /* dapat dibuka atau tidak */ sound(861); delay(1000); nosound(); delay(2000); gotoxy(24,12);printf(" continue.......to create "); /* dapat dibuka atau tidak */ delay(1000); exit(1); } if( fwrite ( &akhir, sizeof(akhir), 1, fpt) != 1) { gotoxy(20,12);printf("Pengujian pengiraan data PELAJAR.DAT rosak ");/* menguji samada data */ sound(861); delay(1000); nosound(); /* dapat dibaca dari fail */ exit(1); } if( fwrite ( &pelajar, sizeof(pelajar), 1, fpt) != 1) { gotoxy(20,12);printf("Data PELAJAR.DAT tidak dapat dibaca\n");/* membaca samada data */ sound(861); delay(1000); nosound(); /* dapat dibaca dari fail */ getch(); exit(1); } clrscr(); _setcursortype(_NOCURSOR); textcolor(YELLOW); textbackground(MAGENTA); gotoxy(24,12); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(24,13); cprintf(" >>>>>>REKOD SEDANG DI SIMPAN<<<<<< "); gotoxy(24,14); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); textcolor(7); delay(2500); textbackground(0); _setcursortype(_NORMALCURSOR); clrscr(); fclose ( fpt ); } /* tamat fungsi simpan_fail */ /* Fungsi cari_pelajar: Mengesan data dalam fail data melalui no. meterik */ void cari_pelajar ( void ) { int dapat = 0; char kod[15]; clrscr(); textcolor(2); gotoxy(23,8); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(23,9); cprintf(" º SISTEM MENGESAN DATA PELAJAR º "); gotoxy(23,10); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); gotoxy(35,14); cprintf("Masukkan matrik:"); window(35,15,40,35); textcolor(4); textbackground(3); gotoxy(35,15); cprintf("[ ]"); kod[0]=14; gotoxy(36,15); p=cgets(kod); textcolor(7); textbackground(0); for(i=0; i=markahAwal) && (markah<=markahAkhir)){ fflush(stdin);strcpy(pelajar[i].rd.gred, ahli[j].mk.gred); fflush(stdin);strcpy(pelajar[i].rd.kredit, ahli[j].mk.kredit);} } /* penutup if */ break; } /* penutup for j */ } /* penutup switch */ } /* penutup for i*/ if(!dapat) { ralat(); /* memanggil fungsi 'ralat' */ return; } /* penutup if */ simpan_fail(); /* memanggil fungsi 'simpan_fail' */ clrscr(); stream = fopen("a:pelajar.dat", "r"); gotoxy (20,24);cprintf("pelajar.dat: %ld bytes status: %s", filesize(stream), file_exists("a:pelajar.dat") ? "access" : "NO"); fclose(stream); delay(2000); papar_semua_pelajar(); } /* tamat fungsi kemaskini_pelajar */ /* Memaparkan menu_kemaskini */ int menu_kemaskini ( void ) { int choice; char z[3]; do { clrscr(); textcolor(10); gotoxy(20,3); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(20,4); cprintf(" º PILIH DATA YANG HENDAK DIKEMASKINI: º "); gotoxy(20,5); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); gotoxy(22,8); cprintf(" 1 * TIADA "); gotoxy(22,10); cprintf(" 2 * NAMA "); gotoxy(22,12); cprintf(" 3 * NO. MATRIK "); gotoxy(22,14); cprintf(" 4 * MATAPELAJARAN "); gotoxy(22,16); cprintf(" 5 * MARKAH "); textcolor(3); gotoxy(20,21); cprintf("Sila masukkan pilihan anda *> [ ] "); z[0]=2; textcolor(10); gotoxy(51,21); p=cgets(z); choice = atoi(p); if ( choice < 1 || choice > 6 ) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while (choice < 1 || choice > 6); return choice; } /* penutup menu_kemaskini */ /* Menghapuskan data pelajar */ void hapus_pelajar ( void ) { int dapat = 0; int y,j,k; char x[3]; char kod[15]; char ganti[25] = {""}; clrscr(); textcolor(10); gotoxy(22,5); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(22,6); cprintf(" º SISTEM MENGHAPUSKAN DATA º "); gotoxy(22,7); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); textcolor(3); gotoxy(19,12); cprintf("Masukkan nombor matrik yang perlu dihapuskan : \n"); textcolor(4); textbackground(3); kod[0]=14; gotoxy(34,14); cprintf("[ ]"); gotoxy(35,14); p=cgets(kod); textcolor(7); textbackground(0); for(i=0; i untuk menghapuskan data..."); gotoxy(18,24); cprintf("ATAU tekan <1> jika tidak mahu"); x[0]=2; gotoxy(50,24); p=cgets(x); y = atoi(p); if( y == 1 ) { return; } strcpy ( pelajar[i].nama , ganti ); strcpy ( pelajar[i].metrik , ganti ); strcpy ( pelajar[i].rd.matapelajaran , ganti ); strcpy ( pelajar[i].rd.markah , ganti ); strcpy ( pelajar[i].rd.gred , ganti ); strcpy ( pelajar[i].rd.kredit , ganti ); strcpy ( pelajar[i].rd.tk.hari , ganti); strcpy ( pelajar[i].rd.tk.bulan , ganti); strcpy ( pelajar[i].rd.tk.tahun, ganti); for(j=i; j>>>>>REKOD TELAH DIHAPUSKAN<<<<<< "); gotoxy(24,14); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); textcolor(7); delay(2500); textbackground(0); _setcursortype(_NORMALCURSOR); clrscr(); akhir = akhir * 1; simpan_fail(); /* memanggil fungsi 'simpan_fail' */ } /* penutup if */ } /* penutup for i */ if(!dapat) { /* memanggil fungsi 'ralat' */ ralat(); } } /* tamat fungsi hapus_pelajar*/ /* Memaparkan menu_papar */ int menu_papar ( void ) { int yes; char no[3]; do { clrscr(); textcolor(10); gotoxy(19,4); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(19,5); cprintf(" º MENU PAPAR DATA º "); gotoxy(19,6); cprintf(" ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ "); gotoxy(19,7); cprintf(" º º "); gotoxy(19,8); cprintf(" º º "); gotoxy(19,9); cprintf(" º 1 * SEMUA PELAJAR DENGAN NO.MATRIK º "); gotoxy(19,10); cprintf(" º º "); gotoxy(19,11); cprintf(" º 2 * SEMUA PELAJAR SATU PERSATU º "); gotoxy(19,12); cprintf(" º º "); gotoxy(19,13); cprintf(" º 3 * DATA INDIVIDU º "); gotoxy(19,14); cprintf(" º º "); gotoxy(19,15); cprintf(" º 4 * KEMBALI KE MENU UTAMA º "); gotoxy(19,16); cprintf(" º º "); gotoxy(19,17); cprintf(" º º "); gotoxy(19,18); cprintf(" º º "); gotoxy(19,19); cprintf(" º MASUKKAN PILIHAN ANDA *> [ ] º "); gotoxy(19,20); cprintf(" º º "); gotoxy(19,21); cprintf(" º º "); gotoxy(19,22); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); textcolor(7); no[0]=2; gotoxy(53,19); p=cgets(no); yes = atoi(p); if ( yes < 1 || yes > 4 ) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while ( yes < 1 || yes > 4 ); return yes; } /* tamat fungsi menu_papar */ /* fungsi menu_papar_pel: Memaparkan data pelajar */ void menu_papar_pel ( void ) { int pick; int dapat = 0; char kod[15]; pick = menu_papar(); /* memanggil fungsi 'menu_papar' */ switch(pick) { case 1 : papar_semua_pelajar(); break; case 2 : for ( i=0; i Û"); gotoxy(21,22); cprintf("ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ"); textcolor(4+BLINK); gotoxy(27,9); cprintf("["); gotoxy(29,9); cprintf("]"); gotoxy(27,11); cprintf("["); gotoxy(29,11); cprintf("]"); gotoxy(27,13); cprintf("["); gotoxy(29,13); cprintf("]"); gotoxy(27,15); cprintf("["); gotoxy(29,15); cprintf("]"); gotoxy(27,17); cprintf("["); gotoxy(29,17); cprintf("]"); gotoxy(27,19); cprintf("["); gotoxy(29,19); cprintf("]"); textcolor(11+BLINK); gotoxy(56,21); cprintf("["); gotoxy(58,21); cprintf("]"); Jam(); textcolor(4); a[0]=2; gotoxy(57,21); p=cgets(a); textbackground(0); pilihan = atoi(p); textcolor(7); if ( pilihan < 1 || pilihan > 6) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while ( pilihan < 1 || pilihan > 6); return (pilihan); } /* tamat fungsi menu gred */ /* fungsi input_gred: Masuk data ke dalam fail */ void input_gred ( void ) { int a, panjang, x=0; clrscr(); textcolor(7); for(a = 0; a<20; a++) { textcolor(10); gotoxy(12,4+a);cprintf("%s",kotakGred[a]); textcolor(12); } /* penutup for a */ gotoxy(30,5); cprintf("SISTEM KONFIGURASI GRED"); gotoxy(3,25); cprintf("Sila tekan dan taip Gred sekarang.."); Jam(); /* memanggil fungsi jam */ getch(); j=1; for ( i=0; i<14; i++ ) { textcolor(14); gotoxy(15,8+j); cprintf("%d", j); gotoxy(21,8+j);strcpy(ahli[i].mk.gred,input(3)); gotoxy(3,25); cprintf(" "); gotoxy(21,8+j); cprintf("%s",ahli[i].mk.gred); if ( !*ahli[i].mk.gred ) { textcolor(12); gotoxy(3,25); cprintf("Sistem keluar ke menu utama"); break; } /* penutup if */ textcolor(14); gotoxy(31,8+j);strcpy(ahli[i].markahA,input(4)); gotoxy(31,8+j);cprintf("%s",ahli[i].markahA); gotoxy(46,8+j);strcpy(ahli[i].markahB,input(4)); gotoxy(46,8+j);cprintf("%s",ahli[i].markahB); gotoxy(60,8+j);strcpy(ahli[i].mk.kredit,input(5)); gotoxy(60,8+j);cprintf("%s",ahli[i].mk.kredit); textcolor(14); gotoxy(3,25); cprintf("tekan 2 kali sekarang jika hendak berhenti ATAU teruskan input Gred"); j++; strcpy(ahli[i].tkh.hari ,bill[x].tk.hari); strcpy(ahli[i].tkh.bulan ,bill[x].tk.bulan); strcpy(ahli[i].tkh.tahun ,bill[x].tk.tahun); Jam(); /* memanggil fungsijam */ getch(); } /* penutup for i*/ textcolor(7); akhir1 = i; simpan_gred(); /* memanggil funsi simpan_gred */ return; } /* tamat fungsi input gred */ /* fungsi simpan_gred: Menulis data ke dalam fail data */ void simpan_gred ( void ) { FILE *fpt; if (( fpt = fopen ("a:gred.dat","w")) == NULL) { gotoxy(24,12);printf(" Fail gred.dat tiada "); sound(861); delay(1000); nosound(); exit(1); } /* penutup if */ if( fwrite ( &akhir1, sizeof(akhir1), 1, fpt) != 1) { gotoxy(24,12);printf("Fail gred.dat tidak dapat ditulis "); exit(1); } /* penutp if */ if( fwrite ( &ahli, sizeof(ahli), 1, fpt) != 1) { gotoxy(24,12);printf("Fail gred.dat tidak dapat di tulis "); exit(1); } /* penutp if */ fclose ( fpt ); }/* tamat fungsi simpan_gred */ /* fungsi cari_gred: Mengesan data gred melalui abjad gred */ void cari_gred ( void ) { int dapat = 0; char kod[4]; clrscr(); textcolor(10); gotoxy(22,8); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(22,9); cprintf(" º SISTEM MENGESAN GRED PELAJAR º "); gotoxy(22,10); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); gotoxy(28,14); cprintf("Masukkan gred pelajar:[ ] "); textcolor(3); kod[0]=3; gotoxy(51,14); p=cgets(kod); for(i=0; i [ ] "); textcolor(14); z[0]=2; gotoxy(51,21); p=cgets(z); choice = atoi(p); textcolor(7); if ( choice < 1 || choice > 5 ) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while (choice < 1 || choice > 5); clrscr(); return choice; } /* tamat fungsi 'menu_kemas_gred' */ /* fungsi 'hapus_data': Menghapuskan data */ void hapus_gred ( void ) { int y,j,k; char x[3]; char file[80]; clrscr(); textcolor(5+BLINK); gotoxy(20,12); cprintf("ADAKAH ANDA PASTI INGIN MENGHAPUSKANNYA ?"); textcolor(12); gotoxy(15,23); cprintf("Sila tekan untuk menghapuskan data..."); gotoxy(15,24); cprintf("ATAU tekan jika tidak mahu"); textcolor(10); y = bioskey(0); clrscr(); if( y == 0x11b ) //arahan escape return; /* delete the file */ else if (remove("a:gred.dat") == 0) { textcolor(4); gotoxy(26,12); printf("DATA TELAH DI HAPUSKAN"); delay (1000); } else { gotoxy(20,13); perror("remove"); } textcolor(14); gotoxy(20,12); cprintf("Tekan untuk kembali ke menu"); getch(); clrscr(); stream = fopen("a:gred.dat", "r"); gotoxy (20,12);cprintf("gred.dat: %ld bytes status: %s", filesize(stream), file_exists("a:pelajar.dat") ? "access" : "NO"); fclose(stream); textcolor(7); delay(2000); } /* tamat fungsi 'hapus_gred' */ /* fungsi 'menu_papar_gred' */ int menu_papar_gred ( void ) { int yes; char no[3]; do { clrscr(); textcolor(13); gotoxy(24,6); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(24,7); cprintf(" º MENU PAPAR DATA º "); gotoxy(24,8); cprintf(" ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹ "); gotoxy(24,9); cprintf(" º º "); gotoxy(24,10); cprintf(" º º "); gotoxy(24,11); cprintf(" º 1 * SEMUA DATA º "); gotoxy(24,12); cprintf(" º º "); gotoxy(24,13); cprintf(" º 2 * GRED TERTENTU º "); gotoxy(24,14); cprintf(" º º "); gotoxy(24,15); cprintf(" º 3 * KEMBALI KE MENU GRED º "); gotoxy(24,16); cprintf(" º º "); gotoxy(24,17); cprintf(" º º "); gotoxy(24,18); cprintf(" º º "); gotoxy(24,19); cprintf(" º MASUKKAN PILIHAN ANDA *> [ ] º "); gotoxy(24,20); cprintf(" º º "); gotoxy(24,21); cprintf(" º º "); gotoxy(24,22); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); no[0]=2; textcolor(10); gotoxy(54,19); p=cgets(no); yes = atoi(p); if ( yes < 1 || yes > 3 ) { ralat2 (); /* panggilan fungsi ralat2 */ } /* penutup if */ } while ( yes < 1 || yes > 3 ); return yes; } /* tamat fungsi 'menu_papar_gred' */ /* fungsi 'papar_pilih_gred': Memaparkan data yang berkaitan dengan gred */ void papar_pilih_gred ( void ) { int pick; int dapat = 0; char kod[4]; pick = menu_papar_gred(); /* memanggil fungsi 'menu_papar_gred' */ switch(pick) { case 1 : papar_semua_gred(); /* memanggil fungsi 'papar_gred' */ break; case 2 : clrscr(); textcolor(2); gotoxy(23,5); cprintf(" ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» "); gotoxy(23,6); cprintf(" º KESAN DATA º "); gotoxy(23,7); cprintf(" ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ "); gotoxy(19,12); cprintf("Masukkan gred pelajar yang hendak dipaparkan : "); gotoxy(40,14); cprintf("[ ]"); kod[0]=3; textcolor(12); gotoxy(41,14); p=cgets(kod); textcolor(7); for(i=0; i=markahAwal) && (markah<=markahAkhir)) { strcpy(pelajar[i].rd.gred, ahli[j].mk.gred); strcpy(pelajar[i].rd.kredit, ahli[j].mk.kredit); textcolor(14); gotoxy(41,15); cprintf("%s", ahli[j].mk.gred); gotoxy(41,17); cprintf("%s", ahli[j].mk.kredit); } /* penutup if */ } /* penutup for j */ struct date d; getdate(&d); itoa(d.da_day, hari_d,10); itoa(d.da_mon, bulan_m, 10); itoa(d.da_year, tahun_y, 10); strcpy(pelajar[i].rd.tk.hari ,hari_d); strcpy(pelajar[i].rd.tk.bulan ,bulan_m); strcpy(pelajar[i].rd.tk.tahun ,tahun_y); gotoxy(41,19); cprintf("%s/%s/%s",pelajar[i].rd.tk.hari, pelajar[i].rd.tk.bulan,pelajar[i].rd.tk.tahun); bil++; delay(1000); } /* penutup for i*/ textcolor(12); gotoxy(3,25); cprintf("tekan apabila tamat"); akhir = i; akhir1 = j; getch(); textcolor(7); simpan_fail(); /* memanggil fungsi 'simpan_fail' */ return; } /* tamat fungsi 'update_gred' */ /* fungsi 'tolongAna' : menerangkan hubungan gred dan markah */ void tolongAna(void) { int g, key; clrscr(); textcolor(YELLOW); _setcursortype(_NOCURSOR); char info[22][80]= {"ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»", "º -> Anda boleh terus menginput data pelajar dan markah º", "º jika anda mahu º", "º -> Jika semua data pelajar selesai di input º", "º -> Sila masukkan gred ke dalam sistem gred di bahagian º", "º menu utama dan pilih nombor [7] untuk konfigurasi gred º", "º -> Setelah itu sila pergi ke menu utama dan tekan º", "º nombor [8] untuk meng 'update'kan...atau menyamakan º", "º antara markah dan gred baru seperti yang dikehendaki º", "º -> Anda digalakkan supaya menyempurnakan sistem gred º", "º terlebih dahalu sebelum anda menginput sebarang data º", "º pelajar. º", "º * Anda bebas mengubah gred dan markah mengikut keperluan º", "º dan kehendak anda. º", "ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"}; for(g = 0; g<22; g++) { textbackground(1); gotoxy(9,6+g);cprintf("%s",info[g]); } /* penutup for g */ textbackground(0); textcolor(YELLOW); delay(2500); _setcursortype(_NOCURSOR); gotoxy(21,24);cprintf("Tekan untuk ke konfigurasi gred"); gotoxy(20,25);cprintf("Tekan untuk kembali input data"); /* function 1 returns 0 until a key is pressed */ while (bioskey(1) == 0); /* function 0 returns the key that is waiting */ key = bioskey(0); if (key== 0x3c00){ konfigurasi_gred(); } /* penutup if */ textbackground(0); textcolor(7); } /* tamat fungsi 'tolongAna' */ /* fungsi ralat: Memaparkan mesej ralat jika data tiada dalam fail */ void ralat ( void ) { clrscr(); sound(261); delay(150); nosound(); sound(183); delay(300); nosound(); _setcursortype(_NOCURSOR); textcolor(YELLOW); textbackground(RED); gotoxy(24,12); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(24,13); cprintf(" ???????? TIADA DALAM REKOD ????????"); gotoxy(24,14); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); delay(1500); textcolor(7); textbackground(0); _setcursortype(_NORMALCURSOR); }/* tamat fungsi ralat */ /* fungsi ralat2: memapar mesej ralat input pilihan kepada menu */ void ralat2 (void) { sound(451); delay(150); nosound(); sound(355); delay(300); nosound(); _setcursortype(_NOCURSOR); textcolor(YELLOW); textbackground(RED); gotoxy(24,12); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); gotoxy(24,13); cprintf(" PASTIKAN PILIHAN ANDA ADALAH TEPAT "); gotoxy(24,14); cprintf("ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"); delay(1500); textcolor(7); textbackground(0); _setcursortype(_NORMALCURSOR); } /* tamat fungsi ralat2 */ /* fungsi 'Scroll': Keluar dari aturcara */ void Scroll() { unsigned a; textbackground(0); textcolor(0); for(a=0;a<25;a++) { gotoxy(1, 1); delline(); delay(20); } return; } /* tamat fungsi Scroll */