using System;
public class BankAccount {
private double interestRate;
private double balance;
public BankAccount(double interestRate) {
this.interestRate = interestRate;
this.balance = 0.0;
}
public double Balance {
get{
return balance;
}
}
public void Withdraw (double amount) {
balance -= amount;
}
public void Deposit (double amount) {
balance += amount;
}
public void AddInterests() {
balance = balance + balance * interestRate;
}
public override string ToString() {
return "The account holds " +
+ balance + " kroner";
}
} |