Concept explainers
The value of a saving account, V, after t years is given by:
where P is the initial investment, r is the yearly interest rate in % (e.g., 7.5% entered as 7.5). and n is the number of times per year that the interest is compounded. Write a MATLAB program in a script file that calculates V. When the program is executed, it asks the user to enter the amount of the initial investment, the number of years. the interest rate, and the number of times per year that the interest is compounded. The output is displayed in the following format: The value of a $XX investment a yearly interest rate of X.X% compounded X times per year, after XX years is $XXXX.XX”, where XXX stands for the corresponding quantities. Use the program to determine the value of a $20,000 investment after 18 years lithe yearly interest rate is 3.5% compounded 6 times a year.
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
MATLAB: An Introduction with Applications
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage