SHARE
TWEET

aku suka bonito

a guest Jul 22nd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. int main(){
  6.     int pilih,pilih2,golongan,gaji;
  7.     string kode,nama,jk;
  8.     int potongan = 200000;
  9.     cout << "Program Menghitung Gaji Bersih Pegawai" << endl;
  10.     cout << "1. Masukkan Data Pegawai" << endl;
  11.     cout << "2. Exit" << endl;
  12.     cout << "Silahkan Pilih Menu:" << endl;
  13.     cin >> pilih;
  14.     cout << endl;
  15.    
  16.     if(pilih == 1){
  17.         cout << "Masukkan Kode Pegawai" << endl;
  18.         cin >> kode;
  19.         cout << endl;
  20.         cout << "Masukkan Nama Pegawai" << endl;
  21.         cin >> nama;
  22.         cout << "Pilih Jenis Kelamin" << endl;
  23.         cout << "1.Laki Laki" << endl;
  24.         cout << "2.Perempuan" << endl;
  25.         cout << "Silahkan pilih :"<<endl;
  26.         cin >> pilih2;
  27.         if(pilih == 1||2){
  28.         jk = (pilih == 1) ? "Laki Laki" : "Perempuan";
  29.         }else{
  30.         cout << "Input Salah";
  31.         }
  32.         cout << endl;
  33.         cout << "Masukkan Golongan : (1/2)" << endl;
  34.         cin >> golongan;
  35.         cout << endl;
  36.        
  37.         if(golongan == 1||2){
  38.         gaji = (golongan == 1) ? 1250000 : 1500000;
  39.         }else{
  40.         cout << "Input Salah";
  41.         }
  42.     }
  43.    
  44.     cout << "Kode :" << kode << endl;
  45.     cout << "Nama :" << nama << endl;
  46.     cout << "Jenis Kelamin :" << jk << endl;
  47.     cout << "Golongan :" << golongan << endl;
  48.     cout << "Gaji :" << gaji << endl;
  49.     cout << "Potongan :" << potongan << endl;
  50.     cout << "Gaji bersih :" << gaji-potongan << endl;
  51. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top