PROGRAM C++ Penghitung Gaji
//Created By Irsad Ma'ruf.....
#include //masukin fungsi stdio.h
#include //agar bisa fungsi cin cout dsb.. masukin iostream.h
main(){
char n[20],g,s,a;
int jm,tarif,gk,gb,tn,tna,pjk,jma,tuntot,i;
i=0 ;
cout <<"-----SELAMAT DATANG DI PT.MAJU TERUS----- \n";
while(i<100){
i=i++;
cout <<"\n"<<<".Masukkan nama anda: ";
cin>>n;
cout <<"\n Masukkan jumlah jam kerja anda: ";
cin>>jm;
cout<<"\n Masukkan golongan jabatan anda (A,B,C): ";
cin>>g;
cout<<"\n Masukkan status perkawinan anda(Kawin/Y)&(Bujang/T): ";
cin>>s;
if(g == 'a'||g == 'A')
{
tarif=10000;
gk=jm*tarif;
}
if(g == 'b'||g == 'B')
{
tarif=15000;
gk=jm*tarif;
}
if(g == 'c' || g == 'C')
{
tarif=17500;
gk=jm*tarif;
}
if(gk>500000){
pjk=(15*gk)/100;
}
if(gk<500000){
pjk=0;
}
if (s == 'y'||s == 'Y'){
tn=(15*gk)/100;
cout<<"apakah anda punya anak (Y/T): ";
cin>>a;
if(a == 'y' ||a == 'Y'){
cout<<"berapa anak anda: ";
cin>>jma;
if(jma<4){
tna=((5*gk)/100)*jma;
}
if(jma>3){
tna=((5*gk)/100)*3;
}
}
if(a == 't'||a == 'T'){
tna=0;}
}
if (s == 't'||s == 'T'){
tn=0;
}
tuntot=tn+tna;
gb=(gk+tuntot)-pjk;
cout<<"\nTunjangan keluarga "<<<"\n" ;
cout<<"Tunjangan Anak: "<<<"\n" ;
cout<<"Total tunjangan anda:" <<<"\n";
cout<<"Pajak: "<<<"\n" ;
cout<<"Gaji kotor: "<<<"\n";
cout<<"Saudara "<<<" gaji bersih anda adalah:Rp. "<<<"\n";
}
return 0; }
Komentar
Posting Komentar