Learn how to a build a cloud-first strategyRegister Now

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

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

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.
0
1030071002
Asked:
1030071002
  • 2
2 Solutions
 
silemoneCommented:
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...

http://www.javacoffeebreak.com/java102/java102.html

see my explanation here:

http://www.experts-exchange.com/Programming/Languages/Java/Q_24987310.html
0
 
silemoneCommented:
sight = site
0

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