Question: Week 9 Sample problem 1 - assignment for homework, July 2 / 2 0 2 4 Write a program that reads in: a ) An

Week 9
Sample problem 1- assignment for homework, July 2/2024
Write a program that reads in:
a) An initial investment ($)
b) An annual interest rate (%)
c) A target future value ($)
The program should calculate how many years it takes to grow the initial investment to the target amount, and how much the portfolio is worth.|
To calculate the value of the portfolio after one year, the formula is: (Initial amount)*(100%+ interest rate)
Hints:
Structure your problem-solving - start with a flow chart or pseudocode
How many variables do you need, and what type? The interest rate and the final portfolio value will need to be decimal variables - floats. The initial investment, years of growth, and target value could be integers - int. But regular int, or longint?
Keep track of the years - the number of times an interest payment has been made.
Remember that once interest has been paid, interest the next year is on the combined value of 'initial investment + interest'. (This is called 'compound interest' in the financial world.)
Week 9 Sample problem 1 - assignment for

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!