Question: This is a C++ problem. Thank you . The problem descriptions will usually show at least one test case and the resulting correct output. Ilowever,

This is a C++ problem. Thank you
. The problem descriptions will usually show at least one test case and the resulting correct output. Ilowever, you should test your program on other test cases (that you make up) as well. Making up good test cases is a valuable programming skill, and is part of ensuring your code solution is correct. Problem A: Investments to the moon (20 points) Pretend you have some money that you want to invest in the stock market. Ask the user for: 1. The initial investment 2. Yearly estimated market growth 3. How touch (if any) you wish to withdruw from the account per your 4. The desired level of money you wish to get The growth formula per year is simply: Moneynet - Money (1 + rate) Example 1 {user input is underlined for clarity, underlined text. in your program is not needed). Further note that PDF: will sometimes use 2 spaces where our code only uses 1. (In general I do not recommend cx/asting from PDFS) Initial investment? 1000 Yearly growth rate? 0.1 Yearly withdraw amount? 50 Desired balance? 1000000 Years: 80 Balance at end: 1.0247e+06 Amount withdrawn over period: 1000 Assume you withdraw money from the account after it grows (30 apply the growth rate before withdrawing). You cannot withdruw more than the account hus!. Find out how long it takes to reach the desired amount of money (if it is reachable at all). If the account hits zero money, stop and tell them all the data. Hints and Notes: Example 2 (user input is underlined for clarity, underlined text in your program is not needed). Further note that PDFs will sometimes use 2 spaces where our code only uses I. (In general I do not recommend copy/pasting from PDFS) Initial investment 1000 Yearly growth rate? 0.1 Yearly withdraw amount? Desired balance? 1000000 Years: 73 Balance at end: 1.05115e+06 Amount withdrawn over period: 0 . It's worth double-checking your understanding of the math here. Get a calculator out and try some of the examples out yourself to make sure it all makes sense . Remember to include the cath> library for mathematical operations. . Make sure to match the provided format EXACTLY. Failure to do this will result in a grade of 0. - Unlike lest homework, we want the user input to be entered on the same line as the prompts (Notice in the examples below how the numers are on the same line as the prompt this time?) Notice that the expected output format has an empty lide BEFORE the "years" output. . While there is no cout in the loop in our example you may find it useful to put cout state- ments in the loop while testing so you can visualize what is happening in the loop. Example 3 (user input is underlinex for clarity, uncerlined text in your program is not necel). Further este that PDFs will sometimes use 2 sparxes where our code only uscs 1. (In general I do not recommend copy/pasting from PDFS) Initial investment? 100 Yearly growth rate? 0.1 Yearly withdraw amount? 99999999 Desired balance? 1000000 Examples and format demonstration Follow the format shown in the examples exactly. Otherwise the grading program will not be able to understand your final answer. Years: 1 Balance at end: O Amount withdrawn over period: 110
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
