#include <vcl.h>
#include <conio.h>
#include <stdio.h>
void main()
{
int n,i,gol[10];
float gp[10],tj[10],pjk[10],tgj[10];
char nm[10],nk[10];
printf("Masukan Jumlah Karyawan <maks 10> : ");scanf("%d",&n);
for (i=0;i<n;i++)
{
printf("data ke %d\n",i+1);
printf("Nama : ");scanf("%s",&nm);
printf("NIK : ");scanf("%s",&nk);
printf("Golongan : ");scanf("%d",&gol[i]);
printf("\n");
}
for (i=0;i<n;i++)
{
if (gol[i]==1)
{
gp[i]=1500000;
tj[i]=0.08*gp[i];
pjk[i]=0.04*gp[i];
}
else if (gol[i]==2)
{
gp[i]=2000000;
tj[i]=0.1*gp[i];
pjk[i]=0.06*gp[i];
}
else if (gol[i]==3)
{
gp[i]=2500000;
tj[i]=0.12*gp[i];
pjk[i]=0.08*gp[i];
}
else
{
gp[i]=3000000;
tj[i]=0.15*gp[i];
pjk[i]=0.1*gp[i];
}
tgj[i]=gp[i]+tj[i]-pjk[i];
}
clrscr();
for (i=0;i<n;i++)
{
printf("\nData ke %d\n",i+1);
printf("Nama : %s\n",nm);
printf("NIK : %s\n",nk);
printf("Golongan : %d\n",gol[i]);
printf("Gaji Pokok : Rp %0.0f\n",gp[i]);
printf("Tunjangan : Rp %0.0f\n",tj[i]);
printf("Pajak : Rp %0.0f\n",pjk[i]);
printf("Gaji Bersih : Rp %0.0f\n",tgj[i]);
}
getch();
}
ConversionConversion EmoticonEmoticon