Unknown
#include <constrea>
#include <stdio>
#include <iomanip>
main()
{
int jk,i;
char nm[50][15],gol[50],kpen[50];
int jam[50],tunj[50],tunp[50],lmbr[50],pjk[50],gjktr[50],pndptan[50],ttl=0;

cout<<"program hitung honor karyawan\n";
cout<<"PT.STAY COOL\n\n";
cout<<"Masukan jumlah karyawan: ";cin>>jk;
for(i=1;i<=jk;i++)
{
   cout<<"Karyawan ke- "<<i<<endl;
   cout<<"Nama Karyawan : ";gets(nm[i]);
   cout<<"Golongan(1/2/3) : ";cin>>gol[i];
   cout<<"Pendidikan(1=smu/2=D3/3=S1): ";cin>>kpen[i];
   cout<<"Jumlah Jam Kerja: ";cin>>jam[i];

if(gol[i]=='1')
{tunj[i]=(700000*5)/100;}
else if(gol[i]=='2')
{tunj[i]=(700000*10)/100;}
else if(gol[i]=='3')
{tunj[i]=(700000*15)/100;}
else
{tunj[i]=0;}

switch(kpen[i])
{
case '1':tunp[i]=200000;break;
case '2':tunp[i]=300000;break;
case '3':tunp[i]=400000;break;
default:tunp[i]=0;
}
lmbr[i]=(jam[i]-240)*2500;
gjktr[i]=700000+tunj[i]+tunp[i]+lmbr[i];
pjk[i]=(10*gjktr[i])/100;
pndptan[i]=gjktr[i]-pjk[i];
ttl=ttl+pndptan[i];
}

cout<<"\n\n                             PT. STAY COOL\n";
cout<<"-----------------------------------------------------------------------\n";
cout<<"No. Nama              Tunjangan \n";
cout<<"    Karyawan     ---------------------  Honor              Pendapatan\n";
cout<<"                 Jabatan    Pendidikan  Lembur   Pajak     Bersih\n";
cout<<"-----------------------------------------------------------------------\n";
for(i=1;i<=jk;i++)
{
cout<<setiosflags(ios::left)<<setw(3)<<i;
cout<<setiosflags(ios::left)<<setw(14)<<nm[i];
cout<<setiosflags(ios::left)<<setw(11)<<tunj[i];
cout<<setiosflags(ios::left)<<setw(12)<<tunp[i];
cout<<setiosflags(ios::left)<<setw(9)<<lmbr[i];
cout<<setiosflags(ios::left)<<setw(10)<<pjk[i];
cout<<setiosflags(ios::left)<<setw(15)<<pndptan[i];
cout<<endl;
}
cout<<"-----------------------------------------------------------------------\n";
cout<<"Total Gaji Yang Dikeluarkan                             Rp "<<ttl;


getch();
}

2 Responses

  1. Unknown Says:

    Hehehehe Makasih....^_^
    mkasih juga udah berkunjung n coment disini...hehehe


Posting Komentar