kuchuz

PBO-C ETS : Akun()

Nov 26th, 2020
383
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Akun{
  2.     public String Norek;
  3.     public String Nama;
  4.     public String PIN;
  5.     public int Saldo;
  6.     public Akun(String a,String b, String c, int d){
  7.         this.Norek = a;
  8.         this.Nama = b;
  9.         this.PIN = c;
  10.         this.Saldo = d;
  11.     }
  12.     public boolean ubahsaldo(int x){
  13.         if(this.Saldo+x>=0){
  14.             this.Saldo+=x;
  15.             return true;
  16.         }
  17.         return false;
  18.     }
  19.     public int getsaldo(){
  20.         return this.Saldo;
  21.     }
  22.     public String getname(){
  23.         return this.Nama;
  24.     }
  25.     public boolean cekpin(String x){
  26.         return this.PIN.equals(x);
  27.     }
  28. }
RAW Paste Data