ini sedikit dari saya

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#define N 20
#define M 10
void main()
{
/* Deklerasi Variabel */
clrscr();
char nobp[N][8],nama[N][20];
char mk[N][M][25];
char sks[N][M][3];
char nilai[N][M][3];

int i=1,j,jmlmhs=0,jummk[N];
char lagi;
char bobot[2];
char tb;
char ket[6];
float ts,tm,ip,jb,s;
/* Input Data */
printf(“\nINPUT NILAI MAHASISWA “);
printf(“\n______________________”);
while(1)
{
printf(“\n\nINPUT MAHASISWA KE : %d”,i);
printf(“\n___________________________”);
printf(“\nNo Bp          : “);
gets(&nobp[i][0]);
printf(“\nNama Mahasiswa : “);
gets(&nama[i][0]);
jummk[i]=0;
j=1;
while(1)
{
printf(“\n\nINPUT NILAI MAHASISWA KE : %d”,j);
printf(“\n______________________________”);
printf(“\nMata Kuliah    : “);
gets(&mk[i][j][0]);
printf(“\nSKS            : “);
gets(&sks[i][j][0]);
s=atof(sks[i][j]);
printf(“\nNilai          : “);
gets(&nilai[i][j][0]);
tb=atof(bobot);
jummk[i]=jummk[i]+1;
j++;
printf(“\nADA DATA LAGI      :[Y/T]..?    “);
lagi=getche();
if(lagi==’T’||lagi==’t’)
break;
}
i++;
jmlmhs=jmlmhs+1;
printf(“\nADA MAGASISWA LAGI :[Y/T]..?    “);
lagi=getche();
if(lagi==’T’||lagi==’t’)
break;
}
/* Output Data */
clrscr();
printf(“\nLEMBARAN HASIL NILAI MAHASISWA”);
printf(“\n______________________________\n”);
for(i=1;i<=jmlmhs;i++)
{
printf(“\n NO BP  : %s”,nobp[i]);
printf(“\n NAMA   : %s”,nama[i]);
printf(“\n=================================================”);
printf(“\n Mata Kuliah  \tSKS \tNilai\tBobot\tKeterangan”);
printf(“\n=================================================”);
for(j=1;j<=jummk[i];j++)
{
if (strcmp(nilai[i][j],”a”)==0)
{
strcpy(bobot,”4″);
strcpy(ket,”lulus”);
}
else if (strcmp(nilai[i][j],”b”)==0)
{
strcpy(bobot,”3″);
strcpy(ket,”lulus”);
}
else if(strcmp(nilai[i][j],”c”)==0)
{
strcpy(bobot,”2″);
strcpy(ket,”lulus”);
}
else if(strcmp(nilai[i][j],”d”)==0)
{
strcpy(bobot,”1″);
strcpy(ket,”gagal”);
}
else {
strcpy(bobot,”0″);
strcpy(ket,”gagal”);
}
ts= ts+s;

tm= ts*tb;
ip=tm/ts;

printf(“\n %s          \t%s  \t%s    \t%s \t%s”,mk[i][j],sks[i][j],nilai[i][j],bobot,ket);
}

printf(“\n\n Total Sks             :%2.0f”,ts);
printf(“\n\n total Mutu            :%2.0f”,tm);
printf(“\n\n Indeks Prestasi       :%2.0f”,ip);
}
getch();
}

Iklan