Program Hitung Honor Pegawai PT. ALAKADARNYA
/* Latihan Bab 11 no 2 */
/* Created By: Ipah Hanifah */
# include <stdio.h>
# include <conio.h>
# include <iostream.h>
# include <iomanip.h>
garis()
{
cout<<"-------------------------------------------\n";
}
int lebih(int jk)
{
if(jk>=8)
{
return (jk - 8);
}
else
{
return (0);
}
}
main()
{
int i,n,t=0;
struct
{
char nm[20];
int jk,kl,hh;
int jh;
}
honor[10];
clrscr();
garis();
cout<<" Daftar Honor Pegawai Honorer "<<endl;
cout<<" PT. ALAKADARNYA "<<endl;
garis();
cout<<"Banyak karyawan : ";cin>>n;
for(i=1;i<=n;i++)
{
cout<<" Data Ke - "<<i<<endl;
cout<<" Nama Pegawai : "; gets(honor[i].nm);
cout<<" Jumlah Jam Kerja : "; cin>>honor[i].jk;
cout<<endl;
honor[i].hh=15000;
honor[i].kl=honor[i].jk-8;
honor[i].jh=honor[i].hh+(5000*honor[i].kl);
t = t + honor[i].jh;
}
clrscr();
cout<<" Daftar Honor Pegawai Honorer "<<endl;
cout<<" PT. ALAKADARNYA "<<endl;
garis();
cout<<" No. Nama Jumlah Kelebihan Jumlah "<<endl;
cout<<" Pegawai Jam Kerja Jam Kerja Honor "<<endl;
garis();
for(i=1;i<=n;i++)
{
cout<<i ;
cout<<"\t" <<honor[i].nm;
cout<<"\t" <<honor[i].jk;
cout<<"\t " <<lebih(honor[i].jk);
cout<<"\t "<<honor[i].jh<<endl;
}
garis();
cout<<"Total : Rp. "<<t<<endl;
garis();
getche();
}
Output
Wednesday, January 12, 2011
Bab Structure Part 2
Label:
Borland c++
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment