Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assume that the Certificates of Deposits (CDs) offered by various banks are compounded annually. The final value of the CD is computed using the following

Assume that the Certificates of Deposits (CDs) offered by various banks are compounded annually. The final value of the CD is computed using the following formula:

FinalValue = InitialDeposit * (1 + r)t,

where t is the number of years the CD is invested, and r is the interest rate in decimal form. If the interest rate is 4%, then r = 0.04.

Create a package named cs520.hw2.part1 and complete the following by writing the appropriate classes under this package.

Create a procedural style program that meets the requirements below. Create a class named BankingProceduralStyle and test the final value of two different CDs as specified below. BankA offers 3 year CDs with an interest rate of 4%. BankB offers 4 year CDs with an interest rate of 3%. You have $5000 to invest and considering the above two options. Use the variables for initial deposit, bank name, bank interest, and bank term (# of years) one set of variables for the first CD and a different set of variables for the second CD.

a.Compute the final value of the CD from BankA and display the results to the console.

b.Compute the final value of the CD from BankB and display the results to the console.

c. Using the if-else construct, check which option is better in terms of the final values and display the results to the console.

A sample output with the values above is shown below. Note that your program should not hard code the input values in the calculations of the final value and should only use the variables in the calculations.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions