Contoh Program C++ Hitung Honor Karyawan Kontrak
Tampilan Awal
Tampilan Input
Tampilan Akhir
Adapun listing programnya (borland C++) :
#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <iomanip.h>
main()
{
int
jumkar,D,totga,jumjaker[100],hontap=700000,tunjab[100],honlem[100],penber[100];
char
gol[100],nama[30][100];
float
persentase[100],pajak[100];
cout<<"====================================="<<endl;
cout<<"PROGRAM HITUNG HONOR
KARYAWAN KONTRAK"<<endl;
cout<<" PT. STAY COOL"<<endl;
cout<<"====================================="<<endl;
cout<<"Masukkan Jumlah Karyawan :
"; cin>>jumkar;
for(D=1;D<=jumkar;D++)
{
cout<<"Karyawan Ke - "<<D<<endl;
cout<<"Nama Karyawan
: "; gets(nama[D]);
cout<<"Golongan (1/2/3) : "; cin>>gol[D];
if(gol[D]=='1')
{
persentase[D]=(5/(float)100);
}
else
if(gol[D]=='2')
{
persentase[D]=(10/(float)100);
}
else
if(gol[D]=='3')
{
persentase[D]=(15/(float)100);
}
else
{
persentase[D]=0;
}
cout<<"Jumlah Jam Kerja : "; cin>>jumjaker[D];
if(jumjaker[D]>240)
{
honlem[D]=2500*(jumjaker[D]-240);
}
else
{
honlem[D]=0;
}
tunjab[D]=persentase[D]*hontap;
pajak[D]=(10/(float)100)*(tunjab[D]+honlem[D]);
penber[D]=hontap+tunjab[D]+honlem[D];
penber[D]-=pajak[D];
}
clrscr();
cout<<"\n PT. STAY
COOL"<<endl;
cout<<"========================================================================="<<endl;
cout<<"No. Nama Tunjangan Honor Pajak Pendapatan"<<endl;
cout<<" Karyawan Jabatan Lembur Bersih"<<endl;
cout<<"========================================================================="<<endl;
totga=0;
for(D=1;D<=jumkar;D++)
{
cout<<D<<".
"<<setiosflags(ios::left)<<setw(15)<<nama[D];
cout<<setiosflags(ios::right)<<setw(10)<<tunjab[D];
cout<<setiosflags(ios::right)<<setw(13)<<honlem[D];
cout<<setiosflags(ios::right)<<setw(12)<<pajak[D];
cout<<setiosflags(ios::right)<<setw(16)<<penber[D];
cout<<endl;
totga+=penber[D];
}
cout<<"========================================================================="<<endl;
cout<<setiosflags(ios::right)<<setw(59)<<"Total
Gaji yang dikeluarkan : Rp. ";
cout<<setiosflags(ios::right)<<setw(13)<<totga;
getch();
}
Jika ada yang kurang jelas, komen di bawah ya gaesss..
Sekian dan terima kasih..
0 komentar:
Terima Kasih Sudah Membaca.
Silahkan jika ingin berkomentar. Berkomentarlah dengan baik.