Buat referrensi membuat program kali ini admin akan memberikan contoh program untuk penggajian menggunakan bahasa C , silah kan di simak :
Syntax Program
#include <iostream>
#include <conio.h>
void main ()
{
int jabatan,gapok,anak,kehadiran;
double jamlembur,lembur,jamsostek,potongan1,intensif,tunjangan,tunjangan1,tunjangan2,gatot;
cout<<"\n 1. Direktur";
cout<<"\n 2. Manager";
cout<<"\n 3. Karyawan";
cout<<"\n Jabatan anda = ";
cin>>jabatan;
cout<<"\n Jumlah anak = ";
cin>>anak;
cout<<"\n Kehadiran = ";
cin>>kehadiran;
cout<<"\n Jam Lembur = ";
cin>>jamlembur;
if (jabatan==1)
{
gapok=7000;
cout<<"\n Gaji anda $ 7000/bulan";
}
else if (jabatan==2)
{
gapok=4000;
cout<<"\n Gaji anda $ 4000/bulan";
}
else if (jabatan==3)
{
gapok=2500;
cout<<"\n Gaji anda $ 2500/bulan";
}
tunjangan=gapok*0.15;
cout<<"\n Tunjangan Jabatan anda = $ ";
cout<<tunjangan;
tunjangan2=gapok*0.1;
cout<<"\n Tunjangan Keluarga anda = $ ";
cout<<tunjangan2;
if (anak>=1 && anak<=3);
{
tunjangan1=anak*(0.06*gapok);
cout<<"\n Tunjangan anak anda = $ ";
cout<<tunjangan1;
}
if (anak>3 && anak==0)
{
cout<<"\n Maaf Coba lagi ";
}
if (kehadiran>=25)
{
intensif=gapok*0.1;
cout<<"\n Intensif Kehadiran = $ ";
cout<<intensif;
}
if (kehadiran<21)
{
potongan1=gapok*0.02;
cout<<"\n Potongan karena kehadiran = $";
cout<<potongan1;
jamsostek=gapok*0.02;
cout<<"\n Potongan jamsostek = $";
cout<<jamsostek;
lembur=(gapok*0.01)*jamlembur;
cout<<"\n Lemburan = $ ";
cout<<lembur;
gatot=gapok+tunjangan+tunjangan1+tunjangan2-potongan1-jamsostek;
cout<<"\n Gaji Total = $ ";
cout<<gatot;
getch();
}
}
Hasil Compile
Program Penggajian Menggunakan Borland C++ |
Syntax Program
#include <iostream>
#include <conio.h>
void main ()
{
int jabatan,gapok,anak,kehadiran;
double jamlembur,lembur,jamsostek,potongan1,intensif,tunjangan,tunjangan1,tunjangan2,gatot;
cout<<"\n 1. Direktur";
cout<<"\n 2. Manager";
cout<<"\n 3. Karyawan";
cout<<"\n Jabatan anda = ";
cin>>jabatan;
cout<<"\n Jumlah anak = ";
cin>>anak;
cout<<"\n Kehadiran = ";
cin>>kehadiran;
cout<<"\n Jam Lembur = ";
cin>>jamlembur;
if (jabatan==1)
{
gapok=7000;
cout<<"\n Gaji anda $ 7000/bulan";
}
else if (jabatan==2)
{
gapok=4000;
cout<<"\n Gaji anda $ 4000/bulan";
}
else if (jabatan==3)
{
gapok=2500;
cout<<"\n Gaji anda $ 2500/bulan";
}
tunjangan=gapok*0.15;
cout<<"\n Tunjangan Jabatan anda = $ ";
cout<<tunjangan;
tunjangan2=gapok*0.1;
cout<<"\n Tunjangan Keluarga anda = $ ";
cout<<tunjangan2;
if (anak>=1 && anak<=3);
{
tunjangan1=anak*(0.06*gapok);
cout<<"\n Tunjangan anak anda = $ ";
cout<<tunjangan1;
}
if (anak>3 && anak==0)
{
cout<<"\n Maaf Coba lagi ";
}
if (kehadiran>=25)
{
intensif=gapok*0.1;
cout<<"\n Intensif Kehadiran = $ ";
cout<<intensif;
}
if (kehadiran<21)
{
potongan1=gapok*0.02;
cout<<"\n Potongan karena kehadiran = $";
cout<<potongan1;
jamsostek=gapok*0.02;
cout<<"\n Potongan jamsostek = $";
cout<<jamsostek;
lembur=(gapok*0.01)*jamlembur;
cout<<"\n Lemburan = $ ";
cout<<lembur;
gatot=gapok+tunjangan+tunjangan1+tunjangan2-potongan1-jamsostek;
cout<<"\n Gaji Total = $ ";
cout<<gatot;
getch();
}
}
Hasil Compile
Program Penggajian Menggunakan Borland C++ |
What are the best sports toto in a country without a sports betting
BalasHapusSports betting is coming to a massive global 토토사이트 audience with sports betting coming in a huge way over the next few years,