Run Savings Account
Run Savings Account
Scanner;
public class RunSavingsAccount{
public SavingsAccount(){
balance=0;
}
public static void setInterestRate(double newRate){
InterestRate= newRate;
}
public static double getInterestRate(){
return InterestRate;
}
public double getBalance(){
return balance;
}
public void deposit(double amount){
balance=amount;
}
public double withdraw(double amount){
if(balance>=amount){
balance-=amount;
}
else {
amount=0;
}
return amount;
}