Kamis, 21 April 2011

TUGAS 4

Skrip C++

#include <iostream.h>
#include <conio.h>
#include <stdio.h>

main ()
{
char nama [50], golongan, pendidikan, lanjut, ulangi;
long lembur, tunjab, tunpen, gapok, gatot;
float jamker;
clrscr();
cout<<"\t\t\t** PROGRAM HITUNG GAJI KARYAWAN **";
cout<<"\n===============================================================================";
cout<<"\nNama Karyawan       : ";gets(nama);
cout<<"Golongan Jabatan      : ";cin>>golongan;
cout<<"Pendidikan            : ";cin>>pendidikan;
cout<<"Jumlah jam kerja      : ";cin>>jamker;
gapok = 300000;
cout<<"\nKaryawan Yang Bernama "<<nama;
switch (golongan)
{
case '1':
tunjab = gapok*0.05;
break;
case '2':
tunjab = gapok*0.1;
break;
case '3':
tunjab = gapok*0.15;
break;
default:
tunjab = 0;
}
switch (pendidikan)
{
case '1':
tunpen = gapok*0.025;

break;
case '2':
tunpen = gapok*0.05;
break;
case '3':
tunpen = gapok*0.2;
break;
case '4':
tunpen = gapok*0.3;
break;
default:
tunpen = 0;
}
if (jamker < 8 || jamker > 24)
{
lembur = 0;
}
else
lembur = (jamker - 8)*3500;
gatot = tunjab + tunpen + lembur + gapok;
cout<<"\n\nHonor Yang Diterima        ";
cout<<"\n\tTunjangan Jabatan      Rp. "<<tunjab;
cout<<"\n\tTunjangan Pendidikan   Rp. "<<tunpen;
cout<<"\n\tHonor Lembur           Rp. "<<lembur;
cout<<"\n\t___________________________________________ +";
cout<<"\n\tGaji Total             Rp. "<<gatot;
getch();
}






Tidak ada komentar:

Posting Komentar