Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function that will use a while loop to calculate and output how many years ( n ) it will take an initial investment

Write a function that will use a while loop to calculate and output how many years (n) it will take an initial investment (P0) to grow to more than a specified final value (Pfinal), given an interest rate (r). It should also store the yearly value of the investment in an array (bals).
Your function should use the following outputs, name and inputs: [n,bals]= makin_that_money(P0,Pfinal,r)
Once the number of years has been calculated, produce a graph of the principal at the beginning of each year. For example the first point should be: (0,P0) and the last point should be (n,SomethingALittleBitBiggerThanPfinal)
Be careful not to get stuck in an infinite loop! To receive full credit, you must use while loops and/or if statement to constrain the inputs to valid values.
IN MATLAB CODE

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

Step: 3

blur-text-image

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

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions