Working on a homework assignment and getting stuck. Here are the instructions:
Use App Inventor to create an app with three textboxes (with labels), a button and a label.
- The first textbox is for the amount of the investment, like 1000. It should be NumbersOnly.
- The second textbox is for the APR (the annual percentage rate), entered as, for example, .055 for 5.5%. It should be NumbersOnly.
- The third textbox is for the number of years to invest, NumbersOnly.
- The label below the button is where the final value will go.
- When the button is clicked,
- initialize a variable apr to the apr text.
- initialize a variable value to the investment text.
- loop for the number of years. In the do part of the loop, set value to value(apr+1)*.
- AFTER the loop, set the text of the last label to value
We have to use a loop to calculate it and we can't use the actual formula for calculating compound interest without a loop. Here's the blocks that I have so far:
What am I missing or what did I do wrong?