c++, belajar c++. Salah satu software c++ yang saya buat ini adalah software menghitung gaji karyawan. Hasilnya bisa anda lihat di bawah ini.
Sofware yang saya gunakan bernama Borland C+. Dan CODE-nya adalah sbb :
#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#define jml 30
void main(){
char nama[jml][20],gol[jml],pen[jml],lagi;
int jk[30],i=0,tg[30],tp[30],gp=850000,hl1[30],hl2[30],gb[30],tot=0;
do{
clrscr();
cout<<"Program Hitung Honor Karyawan Kontrak "<<endl;
cout<<"PT. JAYA SEKALI "<<endl;
cout<<"\n<< tampilan input >> "<<endl;
cout<<" Nama Karyawan : ";gets(nama[i]);
cout<<"\nGolongan (1/2/3) : ";cin>>gol[i];
if (gol[i]=='1'){
tg[i]=gp*5/100;
}else if (gol[i]=='2'){
tg[i]=gp*10/100;
}else if (gol[i]=='3'){
tg[i]=gp*15/100;
}
cout<<"\nPendidikan (1=SMU, 2=D3, 3=S1) : ";cin>>pen[i];
if (pen[i]=='1'){
tp[i]=gp*2.5/100;
}else if (pen[i]=='2'){
tp[i]=gp*5/100;
}else if (pen[i]=='3'){
tp[i]=gp*7.5/100;
}
cout<<"\nJumlah jam kerja: ";cin>>jk[i];
if (jk[i]>240){
hl1[i]=jk[i]-240;
hl2[i]=hl1[i]*2500;
}else if(jk[i]<240){
hl2[i]=0;
}
cout<<endl;
gb[i]=gp+tg[i]+tp[i]+hl2[i];
tot=gb[i]+tot;
i++;
cout<<"\n Input Data lagi (y/t) ? :";cin>>lagi;
}while (lagi=='y');
clrscr();
cout<<"\n<< tampilan output >> "<<endl;
cout<<"\nPT. JAYA SEKALI"<<endl;
cout<<"\n--------------------------------------------------------"<<endl;
for (int j=0;j<i;j++){
gotoxy(1,7);cout<<"No.";
gotoxy(6,7);cout<<"Nama";
gotoxy(5,8);cout<<"Karyawan";
gotoxy(16,7);cout<<"Tunjangan";
gotoxy(16,8);cout<<"--------------------";
gotoxy(16,9);cout<<"Jabatan";
gotoxy(26,9);cout<<"Pendidikan";
gotoxy(39,8);cout<<"Honor";
gotoxy(39,9);cout<<"Lembur";
gotoxy(48,8);cout<<"Gaji";
gotoxy(48,9);cout<<"Bersih";
gotoxy(1,11);cout<<"--------------------------------------------------------"<<endl;
gotoxy(1,23);cout<<"--------------------------------------------------------"<<endl;
gotoxy(6,24);cout<<"Total gaji yang dikeluarkan";
gotoxy(1,25);cout<<"--------------------------------------------------------"<<endl;
gotoxy(1,12+j);cout<<j+1;
gotoxy(5,12+j);cout<<nama[j];
gotoxy(16,12+j);cout<<tg[j];
gotoxy(26,12+j);cout<<tp[j];
gotoxy(39,12+j);cout<<hl2[j];
gotoxy(48,12+j);cout<<gb[j];
gotoxy(48,24);cout<<tot;
}
getch();
clrscr();
cout<<" Muhammad Agung Laksono "<<endl;
cout<<" 12111070 "<<endl;
cout<<" TI Malam "<<endl;
getch();
}
2 komentar:
wah mantab c++ :D saya mah cuma bisa vb6 :p nice post sob, happy blogging :)
siip trimakasih,, mantab bro,, :)
Posting Komentar