Posted by Materi Teknik Informatika • Informasi Teknologi Informasi • Digital Marketing on 9/20/2014
/*Program Penggajian Karyawan*/
/*Keterangan dalam Code Block Linux Ubuntu*/
#include <iostream.h> /*include <iostream>*/
#include <conio.h> /*Tidak digunakan*/
#include <stdio.h> /*include <stdio>*/
/*using namespace std;*/
//Program Utama
void main() /*int main()*/
{
/*Deklarasi*/
char stat;
char nama[20];
int nik;
int gaji;
int kasbon;
int j_anak;
int tunjangan;
int transport;
int g_bersih;
printf("\n");
printf(" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
printf(" PROGRAM SLIP PENGGAJIAN KARYAWAN PT SUBUR\n");
printf(" jln. Niaga No.23 Karawang 41321\n");
printf(" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
printf("\n");
printf(" -=-=Menu Slip Gaji=-=-\n");
printf("\n");
printf(" ====================================================\n");
cout<<(" Nama Karyawan : ");cin.get(nama,20);
cout<<(" NIK : ");cin>>(nik);
printf(" Jumlah Anak : ");scanf("%d",&j_anak);
printf(" Ada Kendaraan (Y/T) : ");cin>>(stat);
cout<<(" Gaji Pokok : ");cin>>(gaji);
cout<<(" Kasbon : ");cin>>(kasbon);
printf(" ====================================================\n");
//Hitung Tunjangan
if (j_anak>0)
tunjangan=75000;
else
if (j_anak<=0)
tunjangan=0*75000;
//Hitung Transport
if (stat=='Y'||stat=='y')
transport=120000;
else
if (stat=='T'||stat=='t')
transport=0*120000;
//Hitung Total Gaji Bersih
g_bersih=gaji+tunjangan+transport-kasbon;
cout<<(" * Gaji Pokok : Rp.");cout<<(gaji)<<endl;
cout<<(" * Tunjangan : Rp.");cout<<(tunjangan)<<endl;
printf(" * Transport : Rp.%d\n",transport);
printf(" * Kasbon : Rp.%d\n",kasbon);
printf(" ====================================================\n");
printf(" - Gaji Bersih : Rp.%d\n",g_bersih);
cout<<" "<<endl;
cout<<" TERIMAKASIH TELAH MENGGUNAKAN PROGRAM KAMI"<<endl;
cout<<" "<<endl;
cout<<(" * Copyright by.Septian Maulana 1141177004039");
cout<<" "<<endl;
getch(); /*Tidak digunakan*/
}
Berikut hasil output Program Penggajian Karyawan yang dihasilkan.