Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please follow the instruction ( very important ) 1912275-dt content-rid 43901523 1/courses/CSct A31. (25 pts) You must use a tor loop in the following program

please follow the instruction ( very important )
image text in transcribed
1912275-dt content-rid 43901523 1/courses/CSct A31. (25 pts) You must use a tor loop in the following program Write, compile, debug, and run a program that will use a for loop to do the following Some investments compound interest. This means that the interest is added onto the balance periodically during the year, and the next interest is calculated on this larger balance. This makes the actual return on investment actually greater than just applying the interest rate to just the original investment. The formula for calculating annual compound interest that you must use in this program is shown below. You will have to translate this math formula into a C++ statement(s). (You may break the formula into mutiple C statements, but no credit will be given for the assignment if you use a different formula. V P(1+r)nt V Future Value: the investment with the compound interest P Principal: the original amount of money invested r-the annual interest rate in decimal form (ie, 5% is .05) n the number of times that interest is compounded per year t -the number of years the money has been invested for thus far Write a program that uses a loop to calculate and display the total balance at the end of each year, with the user entering only 3 things once, at the beginning of the program: the total number of years, the principal, and the interest rate. The use will enter the interest rate as the percentage without the % sign, i.e. 5, not .05, not 5%. It should be compounded weekly. The balance each year will be calculated as the original amount plus the compounded interest. For example, for 20 years, $1000 principal, and 5% interest rate, user enters 20, 1000, 5, and your program should display a table with two columns that look and start exactly like below. Show the balance with two decimal places. Balance is V. Calculate V each time using the formula, don't accumulate it.Don't changeP (Hint There are two variables related to years One holds the number of years that the user enters (don't overwite this one) The other one is a year counter that starts at 1 and increments unti it reaches the other one. Use this counter for display on each line and in the formula ) (Hint t is the year countor that changes each time through the loop) Here are the first 3 lines for this example: (there should be 20 lines displayed by your program for this example) Year 1 Balance 1051.25 Year 2 Balance 1105.12 Year 3 Balance 1161.75

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

Multiply out and simplify: (A+BC)(A+B+CDE) = [A]

Answered: 1 week ago