Senin, 17 September 2012

Jawaban PT. SMANLEE C++

Palembang, 18 September 2012 06:30



Jawaban
#include
#include
#include
main()
{
char nik[20],nm[30],gol;
int jk;
float lembur,gaji,total;
cout<<"===================================="<
cout<<"APLIKASI PENGGAJIAN PT. \"SMANLEE\" "<
cout<<"===================================="<
cout<<"Masukkan NIK                      : ";cin>>nik;
cout<<"Masukkan Nama Karyawan               : ";gets(nm);
cout<<"Masukkan Golongan [A..C]   : ";cin>>gol;
cout<<"Masukkan Jumlah Jam Kerja : ";cin>>jk;
cout<<"===================================="<

if (gol=='A'||gol=='a')
            {
             gaji=50000;
            }
else if (gol=='B'||gol=='b')
            {
             gaji=35000;
            }
else if (gol=='C'||gol=='c')
            {
             gaji=20000;
            }
else
            {
             gaji=0;
            }

if (jk>8)
            {
            lembur=(jk-8)*10000;
            }
else
            {
            lembur=0;
            }

total=gaji+lembur;
cout<<"Gaji Pokok                             :Rp. "<
cout<<"Upah Lembur                         :Rp. "<
cout<<"Gaji Dibayarkan Sebesar        :Rp. "<
cout<<"===================================="<
cout<<"Jumlah Jam Kerja = "<
getch();
}

Tidak ada komentar:

Posting Komentar