-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREZA PAGE 107-108.CPP
More file actions
40 lines (35 loc) · 815 Bytes
/
Copy pathREZA PAGE 107-108.CPP
File metadata and controls
40 lines (35 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
contoh program perhitungan pembayaran gaji
*/
#include<iostream.h>
#include<conio.h>
void main()
{
char nama[20];
int jhr_kerja;
int jjam_lembur;
float upah;
float uang_lembur;
float trans_lembur;
float gaji;
cout<<"masukkan nama : ";
cin>>nama;
cout<<"masukkan jml hari kerja : ";
cin>>jhr_kerja;
cout<<"masukkan jml jam lembur : ";
cin>>jjam_lembur;
upah = jhr_kerja * 30000;
uang_lembur = jjam_lembur * 5000;
if (jjam_lembur >= 10)
trans_lembur = 0.1 * uang_lembur;
else
trans_lembur = 0;
gaji = upah + uang_lembur + trans_lembur;
cout<<endl;
cout<<"jumlah upah : "<<setw(10)<<upah<<endl;
cout<<"jumlah uang lembur : "<<setw(10)<<uang_lembur<<endl;
cout<<"transfortr lwmbur : "<<setw(10)<<trans_lembur<<endl;
cout<<"-----------+ "<<endl;
cout<<"gaji yang diterima : "<<setw(10)<<gaji<<endl;
getch();
}