Write a java program that has an abstract class named bank which will have two private members , accountname and accountid , and an abstract method named interest which will calculate the interest rate for 10 years by using the following formula principle*(1+rate)^year. A class named bankclass will inherit the abstract class and it will have a member named balance and a constructor which will assign the values to the members, accountname, accountid and balance. bankclass will also have two methods, a deposit method which will add money to the bank account and withdraw which will withdraw money from the account. Create object of the bankclass inside the main class and call the methods.
Write a java program that has an abstract class named bank which will have two private members , accountname and accountid , and an abstract method named interest which will calculate the interest rate for 10 years by using the following formula principle*(1+rate)^year. A class named bankclass will inherit the abstract class and it will have a member named balance and a constructor which will assign the values to the members, accountname, accountid and balance. bankclass will also have two methods, a deposit method which will add money to the bank account and withdraw which will withdraw money from the account. Create object of the bankclass inside the main class and call the methods.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images