Sunday, 31 May 2015

Program Pengggajian Karyawan dengan bahasa C++ (Quiz Online Mesran.net)






















#include "iostream.h"
#include "conio.h"

void main ()
{
int i;
int nik[15],gol[15];
char * nama;
int jumdata =3;
long gaji,pajak,gajibersih ;

cout <<"Informasi Penggajina Pegawai \n";
for (i=0 ; i<jumdata; i++)
{
cout<<"\nNIK Anda : ";cin>>nik[i];
cout<<"Golongan Anda   : ";cin>>gol[i];

 }
clrscr ();
cout <<"\nInformasi Penggajian Pegawai \n";
cout <<"\n--------------------------------------------------------------------------";
cout <<"\n No   NIK    Nama          Golongan  gaji pokok        pajak   gaji bersih ";
cout <<"\n--------------------------------------------------------------------------";
for (i=0 ; i<jumdata ; i++){
if (gol[i]==1){
gaji =1500000;
}else if (gol[i]==2){
gaji =2500000;
}else if (gol[i]==3){
gaji =3500000;
}
if (nik[i]==1){
nama ="Hendro";
}else if (nik[i]==2){
nama ="Dian";
}else if (nik[i]==3){
nama ="Jhoni";
}

pajak =0.05 * gaji;
gajibersih = gaji-pajak;
gotoxy (2,7+i); cout<<i+1;
gotoxy (8,7+i); cout<<nik[i];
gotoxy (13,7+i); cout<<nama;
gotoxy (31,7+i) ;cout<<gol[i];
gotoxy (40,7+i) ;cout<<gaji;
gotoxy (56,7+i) ;cout<<pajak;
gotoxy (66,7+i) ;cout<<gajibersih;
}
cout <<"\n--------------------------------------------------------------------------";
}


atau  Download [google Drive]

No comments :

Post a Comment