#include<iostream.h>
#include<string.h>
#include<stdio.h>
void main()
{
char nm[30],st[30];
char gol[15];
int ja;
long gp,tg,ta,tta,tn,gb,tt;
cout<<"Nama karyawan : ";cin>>nm;
cout<<"Status : ";cin>>st;
cout<<"Jumlah Anak : ";cin>>ja;
cout<<"Golongan : ";cin>>gol;
cout<<endl;
if (stricmp("3A",gol)==0 || stricmp("3a",gol)==0)
{
gp=3000000;
tg=gp*0.1;
cout<<"Gaji Pokok :"<<gp<<endl;
cout<<"Tunjangan Golongan : "<<tg<<endl;
}
else if (stricmp("2A",gol)==0 || stricmp("2a",gol)==0)
{
gp=3500000;
tg=gp*0.1;
cout<<"Gaji Pokok :"<<gp<<endl;
cout<<"Tunjangan Golongan : "<<tg<<endl;
}
else if (stricmp("2B",gol)==0 || stricmp("2b",gol)==0)
{
gp=4000000;
tg=gp*0.1;
cout<<"Gaji Pokok :"<<gp<<endl;
cout<<"Tunjangan Golongan : "<<tg<<endl;
}
if (stricmp("nikah",st)==0 || stricmp("NIKAH",st)==0)
{
//gp=4000000;
tn=gp*0.2;
if (ja >=2)
{
ta=(gp*0.05)*2;
}
else if(ja <=1)
{
ta=(gp*0.05)*1;
}
cout<<"Tunjangan Anak :"<<ta<<endl;
cout<<"Tunjangan Pernikahan : "<<tn<<endl;
}
else
{
cout<<"Tunjangan Pernikahan : 0"<<endl;
}
cout<<endl;
gb=gp+ta+tn+tg;
cout<<"Gaji Bersih :"<<gb<<endl;
}
tampilan output :
sumber : bahan praktik kuliah
0 komentar:
Terima kasih sudah memberi komentar,
komentar anda sangat berguna untuk menjadikan blog ane lebih baik lagi..
jangan lupa berkunjung kembali..