Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio>
- #include <iostream>
- #include <stdio>
- class pegawai
- {
- public:
- void NP()//NP=Nama Perusahaan
- {
- cout<<"\t\tPT. MERIANG GEMBIRA"<<endl;
- }
- void garis()
- {
- cout<<"-----------------------------------------"<<endl;
- }
- int jum,jumhonor,harilem,totalem,tothonor;
- char TGL[20],nama[20];
- double honor(int b);
- double asu(double c,int d);//c*d
- };
- double pegawai::honor(int b)
- {
- return(b)*3125;
- }
- double pegawai::asu(double c,int d)
- {
- return(c+d);
- }
- void main()
- {
- int a, x=0,totalall[20]={0};
- pegawai title;//ngambil dari class
- pegawai PG,PE[20];
- title.NP();
- title.garis();
- cout<<"JUMLAH\t:";cin>>PG.jum;
- cout<<"TANGGAL INPUT :";gets(PG.TGL);
- //PE[a].tothonor=0;
- for(a=1;a<=PG.jum;a++)
- {
- cout<<"DATA KE\t:"<<a<<endl;
- cout<<"NAMA PEGAWAI:";cin>>PE[a].nama;
- cout<<"JUMLAH JAM KERJA:";cin>>PE[a].jum;
- PE[a].jumhonor=PE[a].honor(PE[a].jum);
- if(PE[a].jum>8)
- {
- PE[a].harilem=PE[a].jum-8;
- PE[a].totalem=PE[a].harilem*1500;
- }
- else
- PE[a].totalem=0;
- PE[a].tothonor=PE[a].asu(PE[a].jumhonor,PE[a].totalem);
- totalall[x]=totalall[x]+PE[a].asu(PE[a].jumhonor,PE[a].totalem);
- }
- clrscr();
- title.NP();
- title.garis();
- cout<<"TANGGAL\t:"<<PG.TGL<<endl;
- title.garis();
- cout<<"No.\tNama\tHonor\tJumlah\t\tHonor\tTotal"<<endl;
- cout<<"\tPegawai\t\tJam Kerja\tLembur\tHonor"<<endl;
- for(a=1;a<=PG.jum;a++)
- {
- cout<<a;
- cout<<"\t"<<PE[a].nama;
- cout<<"\t"<<PE[a].jumhonor;
- cout<<"\t"<<PE[a].jum;
- cout<<"\t\t"<<PE[a].totalem;
- cout<<"\t"<<PE[a].tothonor;
- cout<<endl;
- }
- title.garis();
- cout<<"TOTAL HONOR PEGAWAI SEBESAR\t\t\t"<<totalall[x];
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment