Answer to Question #270585 in Java | JSP | JSF for Shan

Question #270585

Create a parent class “Account” with three variables num, title and bal with two functions withdraw and


deposit. Create a child class “SavingAccount” with a function calculateProfit (that applies 7.5% profit on current balance). Finally create the class “TestApp” that creates the object of Saving account and call withdraw, deposit functions and public data members of Account class. Override withdraw function in SavingAccount to deduct Rs. 250 if the balance after withdrawal of amount is less than 10000.

1
Expert's answer
2021-11-23T11:22:25-0500
public class TestApp {
  public static void main(String[] args) {
    // imple..
  }
}
class SavingAccount {
  private double currentBalance;
  SavingAccount(double currentBalance) {
    this.currentBalance = currentBalance;
  }
  public double calculateProfit() {
    this.currentBalance = (1-0.75) * currentBalance;
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS