Facebook
From Alif Eriksandi Agustino, 8 Months ago, written in C++.
Embed
Download Paste or View Raw
Hits: 315
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6.     string Nama, Kelurahan;
  7.     int posisiAwal, posisiAkhir, Biaya, PPJ, Pemakaian, Tarif, Pajak, Total;
  8.    
  9.   //Judul
  10.     cout << "================================================" << endl;
  11.   cout << "Program Penghitung Pemakaian Listrik Sederhana" << endl;
  12.   cout << "================================================" << endl;
  13.     cout << endl;
  14.    
  15.     //Input Pengguna Listrik
  16.    cout << "Masukkan Nama : ";
  17.     getline (cin,Nama);
  18.     cout << "Kelurahan : ";
  19.     getline(cin,Kelurahan);
  20.     cout << "Masukkan posisi awal kWh Meter : ";
  21.     cin >> posisiAwal;
  22.     cout << "Masukkan posisi akhir kWh Meter : ";
  23.     cin >> posisiAkhir;
  24.     cout << "Masukkan biaya beban saat ini : ";
  25.     cin >> Biaya;
  26.     cout << "Masukkan PPJ (dalam persen) : ";
  27.     cin >> PPJ;
  28.     cout << endl;
  29.    
  30.     //Perhitungan Pemakaian, Tarif, Pajak, dan Total
  31.     Pemakaian = posisiAkhir - posisiAwal;
  32.     Tarif = Pemakaian * Biaya;
  33.     Pajak = Tarif * PPJ/100 ;
  34.     Total = Tarif + Pajak;
  35.  
  36.     //Tampilan Output
  37.     cout << "===================PLN Java=====================" << endl;
  38.     cout << endl;
  39.     cout << "Nama : "<< Nama << endl;
  40.     cout << "Kelurahan : "<< Kelurahan << endl;
  41.     cout << "Pemakaian Bulan Ini : " << Pemakaian << " kWh Meter" << endl;
  42.     cout << "Tarif Listrik : " << "Rp. " << Tarif << ",-" << endl;
  43.     cout << "PPJ 10% : " << "Rp. " << Pajak << ",-" << endl;
  44.     cout << "Total Bayar : " << "Rp. "<< Total << ",-" << endl;
  45.     cout << endl;  
  46.     cout << "================================================" << endl;
  47.  
  48.  return 0;  
  49. }