program c++ hitung honor tugas modul
# include <conio.h>
# include <stdio.h>
# include <iostream.h>
# include <iomanip.h>
int lebih(int jk)
{
if(jk>=8)
{
return (jk - 8);
}
else
{
return (0);
}
}
main()
{
class pegawai
{
public:
char nm[20];
int jk,kl,h,jh,hl;
}pegawai[10];
int i,y,t=0;
char tgl[15];
cout<<" PT. Meriang Gembira "<<endl;
cout<<"Jumlah pegawai :";cin>>y;
cout<<"masukan tangal :";cin>>tgl;
cout<<endl;
cout<<"-------------------------------------------"<<endl;
for(i=1;i<=y;i++)
{
cout<<" Data Ke - "<<i<<endl;
cout<<" Nama Pegawai : "; gets(pegawai[i].nm);
cout<<" Jumlah Jam Kerja : "; cin>>pegawai[i].jk;
cout<<endl;
pegawai[i].h=25000;
pegawai[i].hl=1500;
pegawai[i].kl=pegawai[i].jk-8;
pegawai[i].jh=pegawai[i].h+(1500*pegawai[i].kl);
pegawai[i].jh;
t = t + pegawai[i].jh;
}
cout<<" PT. Meriang Gembira "<<endl;
cout<<"Tanggal: "<<tgl<<endl;
cout<<"======================================================="<<endl;
cout<<"No. Nama honor Jumlah honor total"<<endl;
cout<<" Pegawai Jam Kerja lembur Honor "<<endl;
cout<<"======================================================="<<endl;
for(i=1;i<=y;i++)
{
cout<<setiosflags(ios::left)<<setw(5)<<i;
cout<<setiosflags(ios::left)<<setw(10)<<pegawai[i].nm;
cout<<setiosflags(ios::left)<<setw(13)<<pegawai[i].h;
cout<<setiosflags(ios::left)<<setw(10)<<pegawai[i].jk;
cout<<setiosflags(ios::left)<<setw(9)<<pegawai[i].hl;
cout<<setiosflags(ios::left)<<setw(9)<<pegawai[i].jh<<endl;
}
cout<<"======================================================="<<endl;
cout<<" Total Honor Pegawai Sebesar : Rp."<<t<<endl;
getch();
}
0 Response to "program c++ hitung honor tugas modul"
Posting Komentar