Program ini adalah program sederhana tentang pengolahan data nilai mahasiswa. Program dibuat dengan bahasa C++ / C plus plus.
#include #include #include #include //Declare Variableschar pil , pilmen;int a, b, c, jumat;long nimsrc;//Declare Structstruct {long nim;char nama[21];char kodemk[6];float absn;float tgs;float uts;float uas;float nakh;char hurmut;}msiswa[999];//Declare Functions and Parametersvoid tittle();void main_menu();void clr_dat();void input_dat();void show();void shows_dat();void end();float calc_nakh(float nakh);char calc_hurmut(char hurmut);/*Main Programs=================================================*/void main(){step1:clrscr();tittle();main_menu();cin>>pilmen;switch(pilmen){case '1': clr_dat(); a=0; input_dat(); break;case '2': show(); break;case '3': input_dat(); break;case '4': shows_dat(); break;case 'x': end();if(pil=='Y') return; else break;default : goto step1;}goto step1;}/*===============================================*/void tittle(){cout<<"==========================================="< cout<<" NILAI MAHASISWA JURUSAN INFORMATIKA ="< cout<<"==========================================="< }void main_menu(){cout<<"Menu Utama:"< cout<<"--------------------------------------------"< cout<<"1.Input Data"< cout<<"2.Tampilkan Data"< cout<<"3.Tambahkan Data"< cout<<"4.Tampilkan Seluruh Data"< cout<<"x.Keluar"< cout<<"pilih [1,2,3,4,x]: ";}void clr_dat(){b=0;while(b<=a){msiswa[b].nim=0;msiswa[b].absn=0;msiswa[b].tgs=0;msiswa[b].uts=0;msiswa[b].uas=0;msiswa[b].nakh=0;msiswa[b].hurmut=0;b++;}}void input_dat(){pil='Y';while(pil=='Y'){clrscr();cout<<"\aINPUT DATA MAHASISWA"< cout<<"--------------------------------------------"< cout<<"No. Rek : "<<(a+1)< cout<<"NIM : ";cin>>msiswa[a].nim;cout<<"Nama : ";cin>>msiswa[a].nama;cout<<"Kode MatKul: ";cin>>msiswa[a].kodemk;cout<<"Absensi : ";cin>>msiswa[a].absn;cout<<"Tugas : ";cin>>msiswa[a].tgs;cout<<"UTS : ";cin>>msiswa[a].uts;cout<<"UAS : ";cin>>msiswa[a].uas;cout<<"--------------------------------------------"< msiswa[a].nakh=calc_nakh(msiswa[a].nakh);msiswa[a].hurmut=calc_hurmut(msiswa[a].hurmut);cout<<"Lagi? [y/t]: ";pil=getch();pil=toupper(pil);while((pil!='Y')&&(pil!='T')){pil=getch();pil=toupper(pil);}cout<< a++;}}void show(){clrscr();cout<<"\aTAMPILKAN DATA MAHASISWA"< cout<<"--------------------------------------------"< cout<<"Masukan NIM: ";cin>>nimsrc;b=0;while(!(msiswa[b].nim==nimsrc)&&(b<=a)){b++;}if(!(msiswa[b].nim>0))cout<<"\aTidak terdapat data yang dimaksud..!!\a"<< else{cout<<"HASIL: "< cout<<"--------------------------------------------"< cout<<"NIM : "<< cout<<"Nama : "<< cout<<"--------------------------------------------"< c=0;while(c<=a){while(!(msiswa[c].nim==nimsrc)&&(c<=a)){c++;}if(!(msiswa[c].nim==0)){cout<<"Kode MatKul: "<< cout<<"Absensi : "<< cout<<"Tugas : "<< cout<<"UTS : "<< cout<<"UAS : "<< cout<<"NA : "<< cout<<"HM : "<< < c++;}}cout<<"--------------------------------------------"< }cout<<"Tekan tombol \"M\" untuk kembali kemenu utama..";pil=getch();pil=toupper(pil);while(!(pil=='M')){pil=getch();pil=toupper(pil);}}float calc_nakh(float nakh){nakh=(msiswa[a].uts+(2*msiswa[a].uas)+msiswa[a].tgs)/4;return(nakh);}char calc_hurmut(char hurmut){if ((msiswa[a].nakh>=90.00)&&(msiswa[a].nakh<=100.00))hurmut='A';else if ((msiswa[a].nakh>=75.00)&&(msiswa[a].nakh<=89.00))hurmut='B';else if ((msiswa[a].nakh>=55.00)&&(msiswa[a].nakh<=74.00))hurmut='C';else if ((msiswa[a].nakh>=35.00)&&(msiswa[a].nakh<=54.00))hurmut='D';else if ((msiswa[a].nakh>=0.00)&&(msiswa[a].nakh<=34.00))hurmut='E';elsehurmut='X';return(hurmut);}void shows_dat(){clrscr();cout<<"TAMPILKAN SEMUA DATA NILAI STRUKTUR DATA JURUSAN INFORMATIKA"<< cout<<"============================================================================="< cout<<"|No.| NIM | Nama Mahasiswa |Kode MK|Absensi|Tugas| UTS | UAS | NA |HM |"< cout<<"============================================================================="< b=0;{cout<<"|";cout<<<(b+1); cout<< cout<< cout<< cout<< cout<< cout<< cout<< cout<< cout<< cout<<" |"< b++;}cout<<"============================================================================="< cout<<"Tekan tombol \"M\" untuk kembali kemenu utama..";pil=getch();pil=toupper(pil);while(!(pil=='M')){pil=getch();pil=toupper(pil);}}void end(){cout<<"\n\n\aDibuat oleh: IHSAN FAUZI RAHMAN"< cout<<"Anda yakin akan keluar program?? [Y/T]: "< pil=getch();pil=toupper(pil);while(!((pil=='Y')||(pil=='T'))){pil=getch();pil=toupper(pil);}}
DOWNLOAD VERSI PDF
Aduhh . . .
BalasHapusMass ,, Source Codenya Completen donkk ,, jangan Setengah setengah kayak gitu :D
hohoho
Musti dibenerin dluuJadinya :D