LISTING PROGRAM
#include<stdio>
#include<conio>
#include<iostream>
#include<string>
main()
{
int a,pend,tgol,tpend,tjam,jam,total,h1;
char gol,nama[25],skul[10];
float honor=300000;
cout<<"Program Hitung Honor Karyawan Kontrak"<<endl;
cout<<"PT. Dingin Damai"<<endl;
cout<<" "<<endl;
cout<<"Nama Karyawan : ";cin>>nama;
cout<<"Golongan : ";cin>>gol;
cout<<"Pendidikan (SMU/D3/S1): ";cin>>pend;
cout<<"Jumlah Jam Kerja : ";cin>>jam;
//gol
if (gol == 'A')
tgol=0.05*honor;
else if (gol == 'B')
tgol=0.1*honor;
else
tgol=0.15*honor;
//pend
if (pend == '1')
{
strcpy(skul,"SMU");
tpend=0.025*honor;
}
else if (pend== '2')
{
strcpy(skul,"D3");
tpend=0.05*honor;
}
else
{
strcpy(skul,"S1");
tpend=0.075*honor;
}
//jam
if (jam > 8)
h1=(jam-8)*2500;
else
h1=0;
total = honor + tgol + tpend + h1;
clrscr();
cout<<"karyawan yang bernama : "<<nama<<endl;
cout<<"honor yang diterima"<<endl;
cout<<" "<<endl;
cout<<"Honor tetap Rp. "<<honor<<endl;
cout<<"Tunjangan Jabatan Rp. "<<tgol<<endl;
cout<<"Tunjangan Pendidikan "<<skul;
cout<<" Rp. "<<tpend<<endl;
cout<<"Honor lembur Rp. "<<h1<<endl;
cout<<"_________________________________________+ "<<endl;
cout<<"Honor yang diterima Rp. "<<total;
getch();
}
Liat hasil.......
0Awesome Comments!