-
Notifications
You must be signed in to change notification settings - Fork 0
/
4. Entry Proses Penggajian Karyawan.CPP
83 lines (74 loc) · 1.91 KB
/
4. Entry Proses Penggajian Karyawan.CPP
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char T[8],A[6],S[20],YA,SH;
char td='y';
float AF,AA,MD,IR,DA;
if (td==NULL)
{ clrscr();
gotoxy(25,23);printf("Data Tidak dibuat");
getch(); }
while (td=='y' || td=='Y')
{ clrscr();
printf(" Nandi Hati Dept. Store\n");
printf("Proses Penggajian Karyawan \n");
printf("========================== \n");
printf ("\n");
printf("Bulan :");
scanf("%s", T);
printf("Nomor Induk Karyawan :");
scanf("%s", A);
printf("Nama Karyawan :");
scanf("%s", S);
//Jika diminta menggunakan kondisi If Else dengan satu huruf gunakan scanf("%c" &) dengan syntax fflush(stdin) disamping input
printf("Golongan [A/B/C/D] :");fflush(stdin);
scanf("%c", &YA);
printf("Status Karyawan [M/D/J/S] :");fflush(stdin);
scanf("%c", &SH);
printf("Jumlah Jam Kerja :");
scanf("%f", &AF);
//Ketentuan Proses
//Untuk menggunakan kondisi dengan satu huruf gunakan tanda satu petik ' seperti contoh dibawah
if (YA=='A')
{
IR=1500000;
}
else if (YA=='B')
{
IR=2000000;
} else if (YA=='C')
{
IR=2500000;
} else if (YA=='D')
{
IR=3000000;
}
//Menghitung Gaji Lembur
if (AF>150)
{
AA=(AF-150)*25000;
}
else
{
AA=0;
}
//Menghitung Tunjangan Istri/Suami
if (SH=='M')
{
MD=0.3*IR;
}
else
{
MD=0;
}
DA=IR+AA+MD;
printf("Gaji Pokok :Rp. %8.0f\n", IR);
printf("Gaji Lembur :Rp. %8.0f\n", AA);
printf("Tunjangan Suami/Istri :Rp. %8.0f\n", MD);
printf("Total Gaji Yang Diterima :Rp. %8.0f\n", DA);
printf ("\n");
printf("Masih Ada Penggajian[Y/T] :");fflush(stdin);scanf("%c",&td);
getch();
}}