Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

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


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.
  • 2
2 Solutions
we can't help students here...see
but here's a student sight that may help you a bit...this is a tutorial to help students...


see my explanation here:

sight = site

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now