Headlines News :
Home » » Soal Quis

Soal Quis

Written By josuasg.blogspot.com on 31 May, 2015 | 09:06

Buatlah output seperti tampilan berikut ini :

Informasi Pembayaran Gaji
------------------------------------------------------------------------------------------------
No   NIK   Nama Pegawai       Gol   Gaji Pokok      Pajak    Gaji Bersih
------------------------------------------------------------------------------------------------
 9
 9
 9
 ..
 ..
------------------------------------------------------------------------------------------------

Ketentuan Proses

1. NIK, Gol INPUT
2. Proses Nama Pegawai
     Jika NIK = 1 maka
                  Nama Pegawai = "Hendro"
     Jika NIK = 2 maka
                  Nama Pegawai = "Dian"
     Jika NIK = 3 maka
                  Nama Pegawai = "Jhoni"

3. Proses Gaji Pokok
     Jika GOL = 1 maka
                  GajiPokok= 1500000
     Jika GOL = 2 maka
                  GajiPokok= 2500000
     Jika GOL = 3 maka
                  GajiPokok= 3500000

4. Pajak = 0.05 * Gaji Pokok
5. Gaji Bersih = Gaji Pokok - Pajak

Jawaban Saya
#include <iostream.h>
#include <conio.h>
void main()
{
int nik, gol; float gp, paj, gaber; char *nama;
cout << "Informasi Pembayaran Gaji\n";
cout << "---------------------------------\n";
cout << "Masukkan NIK : "; cin >> nik; cout << "Masukkan Golongan : "; cin >> gol;
cout << "---------------------------------\n"; switch(nik) { case 1:
cout << "Nama : Hendro\n" ; break; case 2:
cout << "Nama : Dian\n" ; break; case 3:
cout << "Nama : Jhoni\n" ; break; default:
cout << "Maaf input yang anda masukkan salah, coba lagi \n\n"; } if(gol==1){ gp=1500000; }
else if(gol==2){ gp=2500000; } else if(gol==3){ gp=2500000; } paj=0.05 * gp; gaber= gp - paj;
cout << "" << nama; cout << "NIK : " << nik; cout << "\nGolongan : " << gol;
cout <<"\nGaji Pokok : " << gp;
cout <<"\nPajak : " << paj;
cout <<"\nGaji Bersih : " << gaber; getch(); }
Share this article :

0 komentar:

Speak up your mind

Tell us what you're thinking... !

 
Support : Copyright © 2015. Teknik Informatika - All Rights Reserved
Template Created by Creating Website Published by josua Template
Proudly powered by Blogger