konversi code online c++ to python

#include<iostream>
#include<iomanip>
 using namespace std;
class Panji{

char no[15],nama[20];
int hasil,bulanlalu,bulansekarang;
long a,b1,b2,b3;
float b,c;
{
cout<<"Input No. Rekening                    : ";cin>>no;
cout<<"Input Nama Pelanggan                  : ";cin>>nama;
cout<<"Input penunjuk meter bulan sebelumnya : ";cin>>bulanlalu;
cout<<"Input penunjuk meter bulan sekarang   : ";cin>>bulansekarang;

hasil = bulansekarang - bulanlalu;
cout<<"Jumlah pemakaiannya adalah "<<hasil<<" kwh \n";

if (hasil >= 20)
{

hasil -= 20;
b1 = 20 * 500;
if (hasil >= 40)
{

hasil -= 40;
b2 = 40 * 800;
b3 = hasil * 1000;
}

else b2 = hasil * 800;
}

else b1 = hasil * 500;
a = b1 + b2 + b3;
b = 0.1 * a;
c = 30000 + a + b;
cout<<"Tagihan listrik atas pelanggan yang bernama "<<nama<<" adalah sebesar : Rp."<<setprecision(7)<<c;

void Panji::again(){
 cout<<"Transaksi lagi?b(Y/N) ";cin>>yn;//transaksi lagi tidak?
  if(yn=='y' || yn=='Y'){
   system("CLS");// diclearscreen dulu
   menu();//jika ya maka akan memanggil lagi method/functionnya menu
  }
  if(yn=='n' || yn=='Y'){
   system("CLS");
   cout<<"Terimakasih telah menggunakan ATM kami"<<endl; // clearscream dan tidak bisa transaksi lagi
  }
}

return 0;
}

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source