Create an output like this...
(Sorry if it looks a bit messy, but the results and listing program remains true, do not worry .. ^ _ ^)
This is the Listing Program :
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char nama[20],pend[3];
int jam,gol;
float hontap=300000,tunjab,tunpend,honlem,hontem;
cout<<"Program Hitung Honor Karyawan Kontrak"<<endl;
cout<<"PT.Dingin Damai"<<endl<<endl;
cout<<"Nama Karyawan : ";gets(nama);
cout<<"Golongan : ";cin>>gol;
cout<<"Pendidikan <SMU|D3|S1> : ";cin>>pend;
cout<<"Jumlah Jam Kerja : ";cin>>jam;
if(gol==1)
{
tunjab=0.05*hontap;
if(strcmp(pend,"SMU")==0)
tunpend=0.025*hontap;
else if(strcmp(pend,"D3")==0)
tunpend=0.05*hontap;
else if(strcmp(pend,"S1")==0)
tunpend=0.075*hontap;
else
tunpend=0;
}
else if(gol==2)
{
tunjab=0.1*hontap;
if(strcmp(pend,"SMU")==0)
tunpend=0.025*hontap;
else if(strcmp(pend,"D3")==0)
tunpend=0.05*hontap;
else if(strcmp(pend,"S1")==0)
tunpend=0.075*hontap;
else
tunpend=0;
}
else if(gol==3)
{
tunjab=0.15*hontap;
if(strcmp(pend,"SMU")==0)
tunpend=0.025*hontap;
else if(strcmp(pend,"D3")==0)
tunpend=0.05*hontap;
else if(strcmp(pend,"S1")==0)
tunpend=0.075*hontap;
else
tunpend=0;
}
else
tunjab=0;
if(jam>8)
honlem=(jam-8)*2500;
else
honlem=0;
hontem = hontap + tunjab + tunpend + honlem;
cout<<"Karyawan Yang Bernama : "<<nama<<endl;
cout<<"Honor yang DiTerima : "<<endl<<endl;
cout<<"Honor Tetap : Rp. "<<hontap<<endl;
cout<<"Tunjangan Jabatan : Rp. "<<tunjab<<endl;
cout<<"Tunjangan Pendidikan : Rp. "<<tunpend<<endl;
cout<<"Honor Lembur : Rp. "<<honlem<<endl;
cout<<" -------------------------- +"<<endl;
cout<<"Honor Yang Di Terima : Rp. "<<hontap<<endl<<endl;
getch();
}
Enjoy it... ^_^
If anyone does not understand please ask and leave a comment ..
and do not forget to follow our blog ..^_^
No comments:
Post a Comment