Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. (Polymorphic Banking Program Using Account Hierarchy) Develop a polymorphic b

ID: 3553127 • Letter: 1

Question

1. (Polymorphic Banking Program Using Account Hierarchy) Develop a polymorphic bank-
ing app using the Account hierarchy created in Exercise 11.8. Create an array of Account references
to SavingsAccount and CheckingAccount objects. For each Account in the array, allow the user to
specify an amount of money to withdraw from the Account using method Debit and an amount of
money to deposit into the Account using method Credit. As you process each Account, determine
its type. If an Account is a SavingsAccount, calculate the amount of interest owed to the Account
using method CalculateInterest, then add the interest to the account balance using method
Credit. After processing an Account, display the updated account balance obtained by using base-
class property Balance.

2. (CarbonFootprint Interface: Polymorphism) Using interfaces, as you learned in this chap-
ter, you can specify similar behaviors for possibly disparate classes. Governments and companies
worldwide are becoming increasingly concerned with carbon footprints (annual releases of carbon
dioxide into the atmosphere) from buildings burning various types of fuels for heat, vehicles burning
fuels for power, and the like. Many scientists blame these greenhouse gases for the phenomenon
called global warming. Create three small classes unrelated by inheritance

Explanation / Answer

Answer 1: http://pastebin.com/zZkb4k5X


Answer 2: http://pastebin.com/iAnFg2qM