KHS Sederhana Menggunakan Bahasa C

Dulu saya pernah share program KHS Sederhana yg sudah saya exe kan, dan sekarang saya akan share codingnya...

Silahkan download file text nya disini atau copy dibawah ini...







#include<stdio.h>
#include<conio.h>
main()
{ int nk,ksi,big,sks_k,sks_ksi,sks_b,bbtk,bbtks,bbtb,mtk,mtks,mtb;
float ip,totmut,totsks;
char nim[3],nm[10],hrfk[1],hrfks[1],hrfb[1];
clrscr();
 sks_k=2;
 sks_ksi=3;
 sks_b=2;

 printf("Masukan Nama :");scanf("%s",&nm);
 printf("Masukan NIM :");scanf("%s",&nim);
 printf("+++++++++++++++++++++++++++++++\n");
 printf("Masukan Nilai Kalkulus :");scanf("%d",&nk);
 printf("Masukan Nilai KSI :");scanf("%d",&ksi);
 printf("Masukan Nilai B.Inggris :");scanf("%d",&big);

 if(nk>=86)
   { strcpy(hrfk,"A");
     bbtk=4; }
 else
 if(nk>=76)
   { strcpy(hrfk,"B");
     bbtk=3; }
 else
 if(nk>=60)
   { strcpy(hrfk,"C");
     bbtk=2; }
 else
 if(nk>=45)
   { strcpy(hrfk,"D");
     bbtk=1; }
 else
 { strcpy(hrfk,"E");
  bbtk=0; }

 if(ksi>=86)
 { strcpy(hrfks,"A");
   bbtks=4; }
 else
 if(ksi>=76)
 { strcpy(hrfks,"B");
   bbtks=3; }
 else
 if(ksi>=60)
 { strcpy(hrfks,"C");
   bbtks=2; }
 else
 if(ksi>=45)
 { strcpy(hrfks,"D");
   bbtks=1; }
 else
 { strcpy(hrfks,"E");
   bbtks=0; }

 if(big>=86)
 { strcpy(hrfb,"A");
   bbtb=4; }
 else
 if(big>=76)
 { strcpy(hrfb,"B");
   bbtb=3; }
 else
 if(big>=60)
 { strcpy(hrfb,"C");
   bbtb=2; }
 else
 if(big>=45)
 { strcpy(hrfb,"D");
   bbtb=1; }
 else
 { strcpy(hrfb,"E");
   bbtb=0; }

  mtk=sks_k*bbtk;
  mtks=sks_ksi*bbtks;
  mtb=sks_b*bbtb;
  totsks=sks_k+sks_ksi+sks_b;
  totmut=mtk+mtks+mtb;
  ip=totmut/totsks;

clrscr();
gotoxy(30,6);printf("KARTU HASIL STUDI");
gotoxy(30,7);printf("=================");
gotoxy(5,10);printf("NIM   :");
gotoxy(5,9);printf("NAMA  :");
gotoxy(30,9);printf("Program Studi   : TEKNIK INFORMATIKA");
gotoxy(30,10);printf("Semester        : III / DL");
gotoxy(5,11);printf("=============================================================");
gotoxy(5,13);printf("=============================================================");
gotoxy(5,17);printf("=============================================================");
gotoxy(5,19);printf("=============================================================");
gotoxy(5,12);printf("||Mata Kuliah||");
gotoxy(5,14);printf("||Kalkulus   ||");
gotoxy(5,15);printf("||KSI        ||");
gotoxy(5,16);printf("||B.Inggris  ||");
gotoxy(20,12);printf("ANGKA");
gotoxy(30,12);printf("sks");
gotoxy(40,12);printf("NILAI");
gotoxy(50,12);printf("BOBOT");
gotoxy(60,12);printf("MUTU||");
gotoxy(5,18);printf("||TOTAL");
gotoxy(5,20);printf("IP :");

/* 1234567890123456789012345678901234567890123456789012345678901234567890 */
/*          1         2         3         4         5         6         7 */


 gotoxy(15,10);printf("%s",nim);
 gotoxy(15,9);printf("%s",nm);
 gotoxy(20,14);printf("%d",nk);
   gotoxy(20,15);printf("%d",ksi);
 gotoxy(20,16);printf("%d",big);
 gotoxy(30,14);printf("%d",sks_k);
 gotoxy(30,15);printf("%d",sks_ksi);
 gotoxy(30,16);printf("%d",sks_b);
 gotoxy(40,14);printf("%s",hrfk);
 gotoxy(40,15);printf("%s",hrfks);
 gotoxy(40,16);printf("%s",hrfb);
 gotoxy(50,14);printf("%d",bbtk);
 gotoxy(50,15);printf("%d",bbtks);
 gotoxy(50,16);printf("%d",bbtb);
 gotoxy(60,14);printf("%d",mtk);
 gotoxy(60,15);printf("%d",mtks);
 gotoxy(60,16);printf("%d",mtb);
 gotoxy(30,18);printf("%.0f",totsks);
 gotoxy(60,18);printf("%.0f",totmut);
 gotoxy(20,20);printf("%.2f",ip);

getch();
}

Comments

Popular posts from this blog

Cara Optimalkan PES 2013 Pada PC Spek Rendah

Serial Key Windows XP Profesional SP 2

ID Flexi Wifi.id Februari 2015