Hallo teman-teman di saya akan memberikan sebuah program menggunakan Bahasa Pemrograman C++ untuk menghitung Gaji Karyawan. Di mana perhitungan gaji nya sebagai berikut !!!
1. Jabatan
a. Golongan 1 = Rp.300.000 /Hari
b. Golongan 2 = Rp.200.000 /Hari
c. Golongan 3 = Rp.100.000 /Hari
2. Pendidikan
a. SMA/SMK = Tunjangan Rp.50.000 /Bulan
b. D3 = Tunjangan Rp.100.000 /Bulan
c. S1/D4 = Tunjangan Rp.200.000 /Bulan
d. S2 = Tunjangan Rp.300.000 /Bulan
3. Status
a. Menikah
a)0 Anak = Tunjangan Rp.150.000 /Bulan
b) 1 Anak = Tunjangan Rp.200.000 /Bulan
c) >2 Anak = Tunjangan Rp.250.000 /Bulan
b. Belum Menikah = Tunjangan Rp.100.000 /Bulan
c. Duda/Janda
a) 0 Anak = Tunjangan Rp.100.000 /Bulan
b) 1 Anak = Tunjangan Rp.150.000 /Bulan
c) >2 Anak = Tunjangan Rp.200.000 /Bulan
4. Lama Kerja
a. <2 Tahun = Tunjangan Rp.0 /Bulan
b. >2 Tahun = Tunjangan Rp.500.000 /Bulan
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
gr(){
cout<<"*=======================================================================*\n";
}
// Nama : ILHAM HERMAWAN
// CALON D3 TEKNIK INFORMATIKA
// SALAM ANAK BANGSA INDONESIA
main(){
awal:
clrscr();
int lama_kerja,jum_hari,gaji_bersih,gaji_sementara,gaji_pokok,gaji_hari,tun_pendidikan,tun_status,tun_lama_kerja,tunjangan,ppn;
char input,nama[20],jabatan,pendidikan,status,jum_anak;
gr();
cout<<"*\t\t\tAPLIKASI MENGHITUNG GAJI\t\t\t*\n";
gr();
cout<<"* Nama \t\t\t\t = ";gets(nama);
cout<<"* [A].GOL 1"<<"\t[B].GOL 2"<<"\t[C].GOL 3\n";
jabatan:
cout<<"* Jabatan\t\t\t = ";cin>>jabatan;
if(jabatan == 'A' || jabatan =='a'){
}else if(jabatan == 'B' || jabatan =='b'){
}else if(jabatan == 'C' || jabatan =='c'){
}else{
goto jabatan;
}
cout<<"* [A].SMA/SMK"<<"\t[B].D3"<<"\t[C].S1/D4"<<"\t[D].S2\n";
pendidikan:
cout<<"* Pendidikan\t\t\t = ";cin>>pendidikan;
if(pendidikan == 'A' || pendidikan =='a'){
}else if(pendidikan == 'B' || pendidikan =='b'){
}else if(pendidikan == 'C' || pendidikan =='c'){
}else if(pendidikan == 'D' || pendidikan =='d'){
}else{
goto pendidikan;
}
cout<<"* [A].Menikah"<<"\t[B].Belum"<<"\t[C].Duda/Janda\n";
status:
cout<<"* Status\t\t\t = ";cin>>status;
if(status == 'A' || status =='a'){
}else if(status == 'B' || status =='b'){
}else if(status == 'C' || status =='c'){
}else{
goto status;
}
if(status == 'A' || status == 'a' || status == 'C' || status == 'c'){
cout<<"* [A].0 Anak"<<"\t[B].1 Anak"<<"\t[C]. >2 anak\n";
jum_anak:
cout<<"* Jumlah Anak\t\t\t = ";cin>>jum_anak;
if(jum_anak == 'A' || jum_anak =='a'){
}else if(jum_anak == 'B' || jum_anak =='b'){
}else if(jum_anak == 'C' || jum_anak =='c'){
}else{
goto jum_anak;
}
}
cout<<"* Lama Kerja Tahun\t\t = ";cin>>lama_kerja;
cout<<"* Jumlah Hari Masuk Kerja /Bulan = ";cin>>jum_hari;
clrscr();
gr();
cout<<"*\t\t\tHASIL MENGHITUNG GAJI\t\t\t\t*\n";
gr();
cout<<"* Nama \t\t\t\t = "<<nama<<"\n";
cout<<"* Jabatan\t\t\t = ";
if(jabatan == 'A' || jabatan =='a'){
cout<<"GOLONGAN 1";
gaji_hari=300000;
}else if(jabatan == 'B' || jabatan =='b'){
cout<<"GOLONGAN 2";
gaji_hari=200000;
}else if(jabatan == 'C' || jabatan =='c'){
cout<<"GOLONGAN 3";
gaji_hari=100000;
}else{
goto jabatan;
}
cout<<"\n";
cout<<"* Pendidikan\t\t\t = ";
if(pendidikan == 'A' || pendidikan =='a'){
cout<<"SMA/SMK";
tun_pendidikan=50000;
}else if(pendidikan == 'B' || pendidikan =='b'){
cout<<"D3";
tun_pendidikan=100000;
}else if(pendidikan == 'C' || pendidikan =='c'){
cout<<"S1/D4";
tun_pendidikan=200000;
}else if(pendidikan == 'D' || pendidikan =='d'){
cout<<"S2";
tun_pendidikan=300000;
}else{
goto pendidikan;
}
cout<<"\n";
cout<<"* Status\t\t\t = ";
if(status == 'A' || status =='a'){
cout<<"Menikah";
}else if(status == 'B' || status =='b'){
cout<<"Belum Menikah";
tun_status=100000;
}else if(status == 'C' || status =='c'){
cout<<"Duda/Janda";
}else{
goto status;
}
cout<<"\n";
if(status == 'A' || status == 'a'){
cout<<"* Jumlah Anak\t\t\t = ";
if(jum_anak == 'A' || jum_anak =='a'){
cout<<"0 Anak";
tun_status=150000;
}else if(jum_anak == 'B' || jum_anak =='b'){
cout<<"1 Anak";
tun_status=200000;
}else if(jum_anak == 'C' || jum_anak =='c'){
cout<<">2 Anak";
tun_status=250000;
}else{
goto jum_anak;
}
cout<<"\n";
}else if(status == 'C' || status == 'c'){
cout<<"* Jumlah Anak\t\t\t = ";
if(jum_anak == 'A' || jum_anak =='a'){
cout<<"0 Anak";
tun_status=100000;
}else if(jum_anak == 'B' || jum_anak =='b'){
cout<<"1 Anak";
tun_status=150000;
}else if(jum_anak == 'C' || jum_anak =='c'){
cout<<">2 Anak";
tun_status=200000;
}else{
goto jum_anak;
}
cout<<"\n";
}
cout<<"* Lama Kerja \t\t\t = "<<lama_kerja<<" Tahun\n";
if(lama_kerja >= 2 ){
tun_lama_kerja = 500000;
}else{
tun_lama_kerja = 0;
}
cout<<"* Jumlah Hari Masuk Kerja \t = "<<jum_hari<<" Hari\n"
<<"-------------------------------------------------------------------------\n";
//Proses Menghitung Gaji
gaji_pokok=gaji_hari*jum_hari;
cout<<"* Gaji Pokok\t\t\t = Rp. "<<gaji_pokok<<",00\n";
tunjangan=tun_pendidikan+tun_status+tun_lama_kerja;
cout<<"* Tunjangan \t\t\t = Rp. "<<tunjangan<<",00\n";
gaji_sementara = gaji_pokok+tunjangan;
ppn=gaji_sementara*0.10;
cout<<"* PPN %10 \t\t\t = Rp. "<<ppn<<",00\n";
gaji_bersih=gaji_sementara-ppn;
cout<<"* Gaji Yang Diterima\t\t = Rp. "<<gaji_bersih<<",00\n";
gr();
input:
cout<<"* Apakah Anda Akan Mengulangi (Y/T)\t = ";cin>>input;
if(input == 'Y' || input == 'y'){
goto awal;
}else if(input == 'T' || input == 't'){
goto akhir;
}else{
goto input;
}
getch();
akhir:
}
#include <conio.h>
#include <stdio.h>
gr(){
cout<<"*=======================================================================*\n";
}
// Nama : ILHAM HERMAWAN
// CALON D3 TEKNIK INFORMATIKA
// SALAM ANAK BANGSA INDONESIA
main(){
awal:
clrscr();
int lama_kerja,jum_hari,gaji_bersih,gaji_sementara,gaji_pokok,gaji_hari,tun_pendidikan,tun_status,tun_lama_kerja,tunjangan,ppn;
char input,nama[20],jabatan,pendidikan,status,jum_anak;
gr();
cout<<"*\t\t\tAPLIKASI MENGHITUNG GAJI\t\t\t*\n";
gr();
cout<<"* Nama \t\t\t\t = ";gets(nama);
cout<<"* [A].GOL 1"<<"\t[B].GOL 2"<<"\t[C].GOL 3\n";
jabatan:
cout<<"* Jabatan\t\t\t = ";cin>>jabatan;
if(jabatan == 'A' || jabatan =='a'){
}else if(jabatan == 'B' || jabatan =='b'){
}else if(jabatan == 'C' || jabatan =='c'){
}else{
goto jabatan;
}
cout<<"* [A].SMA/SMK"<<"\t[B].D3"<<"\t[C].S1/D4"<<"\t[D].S2\n";
pendidikan:
cout<<"* Pendidikan\t\t\t = ";cin>>pendidikan;
if(pendidikan == 'A' || pendidikan =='a'){
}else if(pendidikan == 'B' || pendidikan =='b'){
}else if(pendidikan == 'C' || pendidikan =='c'){
}else if(pendidikan == 'D' || pendidikan =='d'){
}else{
goto pendidikan;
}
cout<<"* [A].Menikah"<<"\t[B].Belum"<<"\t[C].Duda/Janda\n";
status:
cout<<"* Status\t\t\t = ";cin>>status;
if(status == 'A' || status =='a'){
}else if(status == 'B' || status =='b'){
}else if(status == 'C' || status =='c'){
}else{
goto status;
}
if(status == 'A' || status == 'a' || status == 'C' || status == 'c'){
cout<<"* [A].0 Anak"<<"\t[B].1 Anak"<<"\t[C]. >2 anak\n";
jum_anak:
cout<<"* Jumlah Anak\t\t\t = ";cin>>jum_anak;
if(jum_anak == 'A' || jum_anak =='a'){
}else if(jum_anak == 'B' || jum_anak =='b'){
}else if(jum_anak == 'C' || jum_anak =='c'){
}else{
goto jum_anak;
}
}
cout<<"* Lama Kerja Tahun\t\t = ";cin>>lama_kerja;
cout<<"* Jumlah Hari Masuk Kerja /Bulan = ";cin>>jum_hari;
clrscr();
gr();
cout<<"*\t\t\tHASIL MENGHITUNG GAJI\t\t\t\t*\n";
gr();
cout<<"* Nama \t\t\t\t = "<<nama<<"\n";
cout<<"* Jabatan\t\t\t = ";
if(jabatan == 'A' || jabatan =='a'){
cout<<"GOLONGAN 1";
gaji_hari=300000;
}else if(jabatan == 'B' || jabatan =='b'){
cout<<"GOLONGAN 2";
gaji_hari=200000;
}else if(jabatan == 'C' || jabatan =='c'){
cout<<"GOLONGAN 3";
gaji_hari=100000;
}else{
goto jabatan;
}
cout<<"\n";
cout<<"* Pendidikan\t\t\t = ";
if(pendidikan == 'A' || pendidikan =='a'){
cout<<"SMA/SMK";
tun_pendidikan=50000;
}else if(pendidikan == 'B' || pendidikan =='b'){
cout<<"D3";
tun_pendidikan=100000;
}else if(pendidikan == 'C' || pendidikan =='c'){
cout<<"S1/D4";
tun_pendidikan=200000;
}else if(pendidikan == 'D' || pendidikan =='d'){
cout<<"S2";
tun_pendidikan=300000;
}else{
goto pendidikan;
}
cout<<"\n";
cout<<"* Status\t\t\t = ";
if(status == 'A' || status =='a'){
cout<<"Menikah";
}else if(status == 'B' || status =='b'){
cout<<"Belum Menikah";
tun_status=100000;
}else if(status == 'C' || status =='c'){
cout<<"Duda/Janda";
}else{
goto status;
}
cout<<"\n";
if(status == 'A' || status == 'a'){
cout<<"* Jumlah Anak\t\t\t = ";
if(jum_anak == 'A' || jum_anak =='a'){
cout<<"0 Anak";
tun_status=150000;
}else if(jum_anak == 'B' || jum_anak =='b'){
cout<<"1 Anak";
tun_status=200000;
}else if(jum_anak == 'C' || jum_anak =='c'){
cout<<">2 Anak";
tun_status=250000;
}else{
goto jum_anak;
}
cout<<"\n";
}else if(status == 'C' || status == 'c'){
cout<<"* Jumlah Anak\t\t\t = ";
if(jum_anak == 'A' || jum_anak =='a'){
cout<<"0 Anak";
tun_status=100000;
}else if(jum_anak == 'B' || jum_anak =='b'){
cout<<"1 Anak";
tun_status=150000;
}else if(jum_anak == 'C' || jum_anak =='c'){
cout<<">2 Anak";
tun_status=200000;
}else{
goto jum_anak;
}
cout<<"\n";
}
cout<<"* Lama Kerja \t\t\t = "<<lama_kerja<<" Tahun\n";
if(lama_kerja >= 2 ){
tun_lama_kerja = 500000;
}else{
tun_lama_kerja = 0;
}
cout<<"* Jumlah Hari Masuk Kerja \t = "<<jum_hari<<" Hari\n"
<<"-------------------------------------------------------------------------\n";
//Proses Menghitung Gaji
gaji_pokok=gaji_hari*jum_hari;
cout<<"* Gaji Pokok\t\t\t = Rp. "<<gaji_pokok<<",00\n";
tunjangan=tun_pendidikan+tun_status+tun_lama_kerja;
cout<<"* Tunjangan \t\t\t = Rp. "<<tunjangan<<",00\n";
gaji_sementara = gaji_pokok+tunjangan;
ppn=gaji_sementara*0.10;
cout<<"* PPN %10 \t\t\t = Rp. "<<ppn<<",00\n";
gaji_bersih=gaji_sementara-ppn;
cout<<"* Gaji Yang Diterima\t\t = Rp. "<<gaji_bersih<<",00\n";
gr();
input:
cout<<"* Apakah Anda Akan Mengulangi (Y/T)\t = ";cin>>input;
if(input == 'Y' || input == 'y'){
goto awal;
}else if(input == 'T' || input == 't'){
goto akhir;
}else{
goto input;
}
getch();
akhir:
}