Saturday, December 7, 2013

program hitung gaji C++

# include <stdio.h>
# include <conio.h>
# include <iostream.h>
main()
{
char nk[20];
float gol,pen,golongan,pend,jjk,a,juml,total,gaji;
cout<<"    ====================================================="<<endl;
cout<<"    Program Hitung Honor Karyawan Kontrak PT.DINGIN DAMAI\n";
cout<<"    ====================================================="<<endl;
cout<<endl;
cout<<"    Nama Karyawan         : ";gets(nk);
cout<<"    Golongan              : ";cin>>gol;
cout<<"    Pendidikan (SMU[1]/D1[2]/D3[3]/S1[4]): ";cin>>pen;
cout<<"    Jumlah Jam Kerja      : ";cin>>jjk;
   
gaji=300000;
if(gol==1 && pen==1)
{golongan=0.05*300000;
pend=0.025*300000;
}
if(gol==2 && pen==1)
{golongan=0.1*300000;
pend=0.025*300000;
}
if(gol==3 && pen==1)
{golongan=0.15*300000;
pend=0.025*300000;
}
if(gol==1 && pen==2)
{golongan=0.05*300000;
pend=0.05*300000;
}
if(gol==2 && pen==2)
{golongan=0.1*300000;
pend=0.05*300000;
}
if(gol==3 && pen==2)
{golongan=0.15*300000;
pend=0.05*300000;
}
if(gol==1 && pen==3)
{golongan=0.05*300000;
pend=0.2*300000;
}
if(gol==2 && pen==3)
{golongan=0.1*300000;
pend=0.2*300000;
}
if(gol==3 && pen==3)
{golongan=0.1*300000;
pend=0.2*300000;
}
if(gol==1 && pen==4)
{golongan=0.05*300000;
pend=0.3*300000;
}
if(gol==2 && pen==4)
{golongan=0.1*300000;
pend=0.3*300000;
}
if(gol==3 && pen==3)
{golongan=0.15*300000;
pend=0.3*300000;
}

if(jjk>=8)
{
a=jjk-8;
juml=a*3500;
}
else
{
juml=0;
}
total=golongan+pend+juml+300000;
clrscr();
cout<<"karyawan Yang Bernama= "<<nk<<endl;
cout<<"Honor Yang Diterima      "<<endl;
cout<<"Honor Tetap          = Rp. "<<gaji<<endl;
cout<<"Tunjangan Jabatan    = Rp. "<<golongan<<endl;
cout<<"Tunjangan Pendidikan = Rp. "<<pend<<endl;
cout<<"Honor Lembur         = Rp. "<<juml<<endl;
cout<<"Jumlah               = ____________+"<<endl;
cout<<"Honor Yang Diterima    Rp. "<<total<<endl;
getch();
}

No comments:

Post a Comment