Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
716 B
1
Indexable
Never
package Bank;
public class Bank {
    int saldo;

//Konstruktor
    public Bank(int saldo){
        this.saldo = saldo;
    }
    
    public void simpanUang(){
        System.out.println("Selamat datang di Bank Suram");
        System.out.println("Saldo anda saat ini : Rp." + saldo);
        System.out.println("----------------------------");
        System.out.println("Simpan Uang         : Rp. 500000");
        saldo = saldo + 500000;
    }
    
    public void ambilUang(){
        System.out.println("Ambil Uang          : Rp. 150000");
        saldo = saldo - 150000;
    }
    
    public void getSaldo(){
        System.out.println("Saldo saat ini      : Rp." + saldo);
    }
}