SHARE
TWEET

Untitled

a guest Oct 17th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. class Belanja {
  5.     public:
  6.  
  7.     void checkVoucher(int jumlah) {
  8.         if (jumlah >= 30000) {
  9.             if (jumlah >= 40000) {
  10.                 cout << "Anda mendapatkan 2 buah voucher" << endl;
  11.             } else {
  12.                 cout << "Anda mendapatkan 1 buah voucher" << endl;
  13.             }
  14.         } else {
  15.             cout << "Anda tidak mendapatkan voucher" << endl;
  16.         }
  17.     };
  18. };
  19.  
  20. int main() {
  21.     Belanja kasir;
  22.  
  23.     int uang;
  24.  
  25.     cout << "Masukkan jumlah uang = ";
  26.     cin >> uang;
  27.  
  28.     kasir.checkVoucher(uang);
  29.     return 0;
  30. }
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