Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

PROGRAMMING ASSIGNMENT

INSTRUCTIONS

Adapted from: Deitel & Deitel (2017). Visual C# 2015 How to Program (6th ed.). Pearson Education, Inc.

Develop a polymorphic banking application using the Account hierarchy you created. Create the following two SavingsAccount objects and two CheckingAccount objects and store them in an array called "arrays" of Account references to the objects:

Account Name                    Account Number            Initial Balance         Fee Charged         Interest Rate
[your name]-Savings-1                 1                              1,000                                              4%
[your name]-Savings-2                 2                              2,000                                              5%
[your name]-Checking-1               3                              3,000                   3.00
[your name]-Checking -2              4                              4,000                   4.00

Using a "foreach" loop, iterate over each account in the array. For each Accountin the array, first print the account. Next, 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. Specifically, for each account, prompt the user to enter an amount to deposit in the account and call the Credit method. Print the object. Next, prompt the user to enter an amount to withdraw and call the Debit method. Print the object. After the user has made a deposit and a withdrawal from an account, calculate interest if the account is a SavingsAccount and print the object. To perform this step, you must first determine the object's type. If the Account is a SavingsAccount, calculate the amount of interest owed to the Account using method CalculateInterest and print the account a final time. If the account is a CheckingAccount, you do not need to CalculateInterest nor print the account a final time.

Hint: To determine if an account is a savings or checking account, use the .getType method which returns a string representing the Name or FullName property. Then use the ".Equals" method to determine if the returned string is equal to the name of the class. For example, acct.getType().Name returns the string "SavingsAccount" or "CheckingAccount". Once you have determined that an account is a SavingsAccount object, you must "cast" the account object into a SavingsAccount object in order to access its CalculateInterest method. I like to perform this in two steps: declare a differentvariable to hold the reference to the object that has been cast from an Account object into a SavingsAccount object. Then, using this new variable, invoke its CalculateInterest method.

Attachment:- Programming-Assignment-Instructions.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92715887

Have any Question?


Related Questions in Computer Engineering

How does understanding various microsoft office

How does understanding various Microsoft Office applications enhance productivity in education, the workplace, and at home?

What are some of the uses of bayes theorem as in what type

What are some of the uses of bayes' theorem. As in what type of problems could I come across in a Biostatistics quiz

Question a suppose you do shading calculations in the

Question : a) Suppose you do shading calculations in the vertex shader. What happens to the vertex colors when they go from the vertex shader to the fragmant shader? b) Suppose instead you want to do the shading calculat ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

Can someone answer this c questionimplement a base class

Can someone answer this C++ question? Implement a base class Person. Derive classes Student and Instructor from Person. A person has a name and a birthday. A student has a major, and an instructor has a salary. Write the ...

A real estate office manages 50 apartment units when the

A real estate office manages 50 apartment units. When the rent is $550 per month, all units are occupied. However, for each $55 increase in rent per month, one unit becomes vacant. How many units should be rented to maxi ...

Espn pays the nfl 11 billion per year for 8 yrs for the

ESPN pays the NFL $1.1 Billion per year for 8 yrs for the right to exclusively televise football. What is the NPV of the investment if the parent Disney CO has an opportunity interest rate that is equal to the cost of ca ...

In relation to internet connectivity both you and the

In relation to Internet connectivity, both you and the chemists at Plains Research are concerned about security. What network device or devices can be used to address the concern about security?

At a seaside resort where the temperature is 25degc a child

At a seaside resort where the temperature is 25°C, a child holds a 1.5 L balloon. Her grip on the balloon loosens and it sails upward for 4.5 miles. If the atmosphere is 340 torr and the temperature is -18°C, what is the ...

Question suppose a large aerospace engineering firm has

Question : Suppose a large aerospace engineering firm has immediately hired you as a consultant to investigate a potential violation of corporate policy and data theft. You have been informed that an employee may have be ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As