#include<stdio.h>
#include<conio.h>
#include<iostream.h>
int main()
{
int i,j,gol[10],jml_jam_kerja[11],jam_kerja[7],tunjangan[11],
tunjangan_mingguan[11],total[11];
//input//
i=1;
while(i<=3)
{
cout<<"pegawai ke-"<<i;
cout<<"\ngolongan =";
cin>>gol[i];
j=1;
while(j<=6)
{
cout<<"jam hari ke-"<<j<<"=";
cin>>jam_kerja[j];
j=j+1;
}
cout<<"\n";
i=i+1;
}
//proses//
i=1;
while(i<=10)
{
if(gol[i]==1)
{
tunjangan_mingguan[i]=200000;
}
if(gol[i]==2)
{
tunjangan_mingguan[i]=300000;
}
if(gol[i]==3)
{
tunjangan_mingguan[i]=500000;
}
jml_jam_kerja[i]=0;
j=1;
while(j<=3)
{
jml_jam_kerja[i]=jml_jam_kerja[i]+jam_kerja[j];
j=j+1;
}
if(jml_jam_kerja[i]<40)
{
tunjangan[i]=9000*jml_jam_kerja[i];
}
else
{
tunjangan[i]=1000*jml_jam_kerja[i];
}
total[i]=tunjangan_mingguan[i]+tunjangan[i];
i=i+1;
}
i=1;
while(i<=3)
{
cout<<"pegawai ke-"<<i<<"\n";
cout<<"\n-------------------------";
cout<<"golongan = "<<gol[i]<<"\n";
cout<<"jml jam kerja = "<<jml_jam_kerja[i]<<"\n";
cout<<"tunjangan tetap mingguan = "<<tunjangan_mingguan[i]<<"\n";
cout<<"tunjangan kerja = "<<tunjangan[i]<<"\n";
cout<<"total gaji mingguan = "<<total[i];
cout<<"\n";
i++;
cout<<"\n";
}
getch();
}
2010-11-19
program penghitungan gaji pegawai dengan menggunakan array
20.04
RENDI PRATAMA
Diberdayakan oleh Blogger.
0 komentar:
Posting Komentar