93.0k views
4 votes
Write a subclass called savingsaccount that extends account and adds an interest rate variable. write a constructor with 3 arguments (name, balance, interest rate) for the savingsaccount class that uses the super constructor. write a tostring() method for savingsaccount that returns a call to the super tostring() method and the interest rate. write an equals method for savingsaccount that calls the superclass equals method and checks that the interest rates are equal

User Bryant Luk
by
5.0k points

1 Answer

5 votes

public class Account

{

private String name;

private double balance;

public Account(String name, double balance)

{

this.name = name;

this.balance = balance;

}

public String toString() {

return name + ", " + balance;

}

User Ram Rachum
by
4.7k points