Name: ____________________________________________________________
Objective: For Loops
In this program you will create a program that tracks the value of an investment as it earns interest over a number of years. If you recall from Algebra one, the value of an an amount of money increases according to the folowing formula:
Value = Principal X (1 + rate)year
where Principle is the amount of money that the account starts with; rate is the interest rate in decimal, and year is the number of years the account has been opened.
Instructions:
- Create a project called Interest
- Create a form with the following:
- Three text boxes labeled Principal, Interest Rate, and Years
- A tall label field
- A button labeled calculate
- When the user clicks the button, your program should do the following
- Compute value of the account for each year from year 0 to the the year entered in the Years text box.
- Display a list of the computed values in the label
Design Considerations
- Make sure your program checks for invalid values in the text boxes
- You will use a for loop to generate the values. The loop's counter will be the current year you use in the value calculation.
- Each calculation in the loop will be added onto the label field
Grading
| Feature |
Points |
Out of |
Notes |
| Form and validation |
|
4 |
|
| Loop |
|
4 |
|
| Calculation |
|
3 |
|
| Output |
|
4 |
|
| Total |
|
15 |
|
Notes
Comments (0)
You don't have permission to comment on this page.