soal:
"Buatlah output seperti tampilan berikut ini :
Informasi Pembayaran Gaji
------------------------------------------------------------------------------------------------
No NIK Nama Pegawai Gol Gaji Pokok Pajak Gaji Bersih
------------------------------------------------------------------------------------------------
9
9
9
..
..
------------------------------------------------------------------------------------------------
Ketentuan Proses
1. NIK, Gol INPUT
2. Proses Nama Pegawai
Jika NIK = 1 maka
Nama Pegawai = "Hendro"
Jika NIK = 2 maka
Nama Pegawai = "Dian"
Jika NIK = 3 maka
Nama Pegawai = "Jhoni"
3. Proses Gaji Pokok
Jika GOL = 1 maka
GajiPokok= 1500000
Jika GOL = 2 maka
GajiPokok= 2500000
Jika GOL = 3 maka
GajiPokok= 3500000
4. Pajak = 0.05 * Gaji Pokok
5. Gaji Bersih = Gaji Pokok - Pajak "
Jawabannya, dengan C++:
#include "iostream.h"
#include "conio.h"
#include"stdio.h"
void main () {
int i, nip[10], gol[15],jumdata=1;
char *nama;
float gaji, gb, pjk;
cout<<"\n Masukkan Data Pegawai ";
for (i=0; i< jumdata ; i++){
cout<<"\n NIP :";
cin>>nip [i];
cout<<"\n Golongan :";
cin>>gol[i];
}
clrscr(); cout<<"\n Penggajian Pegawai";
cout<<"\n==================================================================";
cout<<"\nNo NIP Nama Golongan|GajiPokok|Pajak|GajiBersih";
cout<<"\n===================================================================";
for (i=0; i if(nip [i]==1){
nama= "Hendro";
} else if(nip [i]==2){
nama= "Dian";
}else if (nip [i]==3) {
nama= "Doni";
}
for (i=0; i if(gol [i]==1){
gaji=150000;
} else if(gol [i]==2){
gaji=250000;
} else if (gol [i]==3) {
gaji= 300000;
}
pjk=0.05 * gaji;
gb= gaji- pjk ;
gotoxy(1,6+i);cout<<""< gotoxy(27,6+i);cout<<""< }
cout<<"\n===================================================================";
}
}
outputnya:
"Buatlah output seperti tampilan berikut ini :
Informasi Pembayaran Gaji
------------------------------------------------------------------------------------------------
No NIK Nama Pegawai Gol Gaji Pokok Pajak Gaji Bersih
------------------------------------------------------------------------------------------------
9
9
9
..
..
------------------------------------------------------------------------------------------------
Ketentuan Proses
1. NIK, Gol INPUT
2. Proses Nama Pegawai
Jika NIK = 1 maka
Nama Pegawai = "Hendro"
Jika NIK = 2 maka
Nama Pegawai = "Dian"
Jika NIK = 3 maka
Nama Pegawai = "Jhoni"
3. Proses Gaji Pokok
Jika GOL = 1 maka
GajiPokok= 1500000
Jika GOL = 2 maka
GajiPokok= 2500000
Jika GOL = 3 maka
GajiPokok= 3500000
4. Pajak = 0.05 * Gaji Pokok
5. Gaji Bersih = Gaji Pokok - Pajak "
Jawabannya, dengan C++:
#include "iostream.h"
#include "conio.h"
#include"stdio.h"
void main () {
int i, nip[10], gol[15],jumdata=1;
char *nama;
float gaji, gb, pjk;
cout<<"\n Masukkan Data Pegawai ";
for (i=0; i< jumdata ; i++){
cout<<"\n NIP :";
cin>>nip [i];
cout<<"\n Golongan :";
cin>>gol[i];
}
clrscr(); cout<<"\n Penggajian Pegawai";
cout<<"\n==================================================================";
cout<<"\nNo NIP Nama Golongan|GajiPokok|Pajak|GajiBersih";
cout<<"\n===================================================================";
for (i=0; i
nama= "Hendro";
} else if(nip [i]==2){
nama= "Dian";
}else if (nip [i]==3) {
nama= "Doni";
}
for (i=0; i
gaji=150000;
} else if(gol [i]==2){
gaji=250000;
} else if (gol [i]==3) {
gaji= 300000;
}
pjk=0.05 * gaji;
gb= gaji- pjk ;
gotoxy(1,6+i);cout<<""< gotoxy(27,6+i);cout<<""<
cout<<"\n===================================================================";
}
}
outputnya:
Komentar
Posting Komentar
Pengunjung Yang baik selalu meninggalkan komentar