mydiaz

Gaji Karyawan

Sep 2nd, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     string nama;
  6.     float gapok, gaber, tjng, gator, pjk;
  7.     const float pr_tjng=0.2;
  8.     const float pr_pjk=0.15;
  9.     cout << "------------------------------" << endl;
  10.     cout << "HITUNG GAJI KARYAWAN" << endl;
  11.     cout << "------------------------------" << endl;
  12.     cout << "Input Nama  = ";
  13.     // cin >> nama; --> Sementara ditinggal dulu ya :(
  14.     getline(cin,nama);
  15.     cout << "Input Gaji Pokok = ";
  16.     cin >> gapok;
  17.    
  18.     tjng=pr_tjng*gapok;
  19.     gator=gapok+tjng;
  20.     pjk=pr_pjk*gator;
  21.     gaber=gator-pjk;
  22.    
  23.    
  24.     cout << "------------------------------" << endl;
  25.     cout << "------------------------------" << endl;
  26.     cout << "SLIP GAJI KARYAWAN" << endl;
  27.     cout << "PT.Maju Mundur" << endl;
  28.     cout << "------------------------------" << endl;
  29.     cout << "Nama \t \t : " << nama << endl;
  30.     cout << "Gaji Pokok \t : " << gapok << endl;
  31.     cout << "Tunjangan \t : " << tjng << endl;
  32.     cout << "Pajak \t \t : " << pjk << endl;
  33.     cout << "Gaji Bersih \t : " << gaber << endl;
  34.     cout << "\nTetap Semangat dan Bekerja Keras" << endl;
  35.    
  36.     cout << "------------------------------" << endl;
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment