troubleshooting Question

I am trying to write a Polymorphism java program I need some help

Avatar of 1030071002
1030071002Flag for United States of America asked on
Java
2 Comments2 Solutions198 ViewsLast Modified:
Polymorphism

1) Write a client program that populates an array of Account objects, where each element is either a CheckingAccount object or a SavingsAccount object (use several of each object)

2) After the array has been populated, loop through each element and perform the following tasks and call the appropriate member functions:

"      Display the initial account balance

"      Prompt and enter a withdrawal amount and Debit() the account

"      Prompt and enter a deposit amount and Credit() the account

"      If the current element is a SavingsAccount object, then calculateInterest() earned and Credit() the account by that amount

"      Finally, Print the updated balance by calling getBalance()

3) After the loop has terminated, Print a heading and start another loop and that calls your toString() method to print each element in the array.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros