...
/Challenge 3: Implement an Account Class using Polymorphism
Challenge 3: Implement an Account Class using Polymorphism
In this challenge, we'll implement an Account class along with two derived classes, Savings and Current.
We'll cover the following...
Problem Statement
Write a code that has:
-
A parent class named
Account
.- Inside it define:
- a protected double member
balance
public void Withdraw(double amount)
public void Deposit(double amount)
public void printBalance()
- a protected double member
- Inside it define:
-
Then, there are two derived classes
Savings
class- has a private member
interestRate
set to
- has a private member