Rabu, 09 Januari 2013

Artikel 10. Membuat program Penghitungan Gaji menggunakan C++.

#include<iostream.h>
#include<string>
void main()
{
            char nama[40],ket[20];
            int jamker; long gapok,gaber,gator,pjk;
            cout<<"NAMA KARYAWAN  : "; cin.getline(nama,40);
            cout<<"GAJI POKOK     : Rp. "; cin>>gapok;
            cout<<"JML. JAM KERJA : ";cin>>jamker;
            gator = gapok*jamker;
            cout<<"============================================="<<endl;
            cout<<"GAJI KOTOR     : "<<gator<<endl;
            if (gator>=3000000)
            {
                        pjk = 0.10*gator;
                        strcpy(ket,"WAJIB PAJAK");
                        gaber = gator - pjk;
            }
            else
            {
                        pjk = 0*gator;
                        strcpy(ket,"TIDAK WAJIB PAJAK");
                        gaber = gator - pjk;
            }
            cout<<"PAJAK          : Rp. "<<pjk<<endl;
            cout<<"GAJI BERSIH    : Rp. "<<gaber<<endl;
            cout<<"KETERANGAN     : "<<ket<<endl;
            cout<<"============================================="<<endl;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Sumber: http://rockrr.blogspot.com/2012/10/membuat-program-penghitung-gaji.html

Tidak ada komentar:

Posting Komentar