Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //conto di risparmio
- public class SavingAccount {
- //creo i campi di esemplare
- private double balance;
- private double interest;
- //costruttori
- public SavingAccount (double initialBalance, double interest) {
- this.balance=initialBalance;
- this.interest=interest;
- }
- //aggiungo metodo getbalance
- public double getBalance (){
- return balance;
- }
- //aggiungo metodo add interest
- public double addInterest (){
- this.balance=this.balance + (this.balance*interest/100);
- return balance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement