Time for action – calculate interest on lump sum
For this calculation, we will allow the user to set the interest rate, but we'll assume a static starting amount of $15,000. You decide whether or not you want to calculate dollars, candy bars, pine cones, or something else entirely.
The formula to calculate simple interest is:
Interest Earned = Principal Amount * Interest Rate * Time
Add a new sprite to the stage. Feel free to choose any sprite you want, but I'm going to select the fantasy13 sprite from the d folder. Name the sprite Lump, as in lump sum.
Create three new for this sprite only variables for the Lump sprite, named lumpSum, interestEarned, and interestRate.
Build the calculation for the Lump sprite. Add the when key pressed block to the Lump sprite's script area. Select the up arrow from the drop-down list.
From the Variables palette, add the set to block to the when key pressed block. Select interestEarned from the variables list.
First, calculate the interest on 15,000 for a time...