You are on page 1of 1

// program hitung gaji

#include <iostream.h>
main()
{
char nama[20],st,u;
int jk,lb,pot,gaji,up;
u='Y';
while (u=='Y' || u=='y')
{
cout<<"Nama Pegawai =";cin>>nama;
cout<<"Status Pegawai T/H =";cin>>st;
cout<<"jam Kerja =";cin>>jk;
//proses
if (st=='T')
{
up=175000;
if (jk>=160)
{
lb= (jk-160)*750;
pot=0;
}
else
{
lb=0;
pot=(160-jk)*1125;
}
}
else
{
up=1000*jk;
lb=0;
pot=0;
}
gaji=up+lb-pot;
cout<<"Upah ="<<up<<endl;
cout<<"Lembur ="<<lb<<endl;
cout<<"Potongan ="<<pot<<endl;
cout<<"Total Gaji ="<<gaji<<endl;
cout<<"Isi Data Lagi Y/T =";cin>>u;
}
}

You might also like