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
#include
#include
#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 "<
cout<<"PT. JAYA SEKALI "<
cout<<"\n<< tampilan input >> "<
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 br="br"> hl2[i]=0;
}
cout<
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 >> "<
cout<<"\nPT. JAYA SEKALI"<
cout<<"\n--------------------------------------------------------"<
for (int j=0;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<<"--------------------------------------------------------"<
gotoxy(1,23);cout<<"--------------------------------------------------------"<
gotoxy(6,24);cout<<"Total gaji yang dikeluarkan";
gotoxy(1,25);cout<<"--------------------------------------------------------"<
gotoxy(1,12+j);cout<
gotoxy(5,12+j);cout<
gotoxy(16,12+j);cout<
gotoxy(26,12+j);cout<
gotoxy(39,12+j);cout<
gotoxy(48,12+j);cout<
gotoxy(48,24);cout<
}
getch();
clrscr();
cout<<" Muhammad Agung Laksono "<
cout<<" 12111070 "<
cout<<" TI Malam "<
getch();
} 240>
Sofware yang saya gunakan bernama Borland C+. Dan CODE-nya adalah sbb :
#include
#include
#include
#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 "<
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 br="br"> hl2[i]=0;
}
cout<
tot=gb[i]+tot;
i++;
cout<<"\n Input Data lagi (y/t) ? :";cin>>lagi;
}while (lagi=='y');
clrscr();
cout<<"\n<< tampilan output >> "<
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<<"--------------------------------------------------------"<
gotoxy(1,25);cout<<"--------------------------------------------------------"<
getch();
clrscr();
cout<<" Muhammad Agung Laksono "<
}
Mari Kita Saling Menghargai Sesama Blogger
Apabila anda merasa artikel ini bermanfaat, silahkan share dimana saja.
Dan jika berkenan mohon mencantumkan link sumbernya. Terima Kasih.
^_^