View
 

Lab 11: Compound Interest

Page history last edited by Mr. Kretsch 5 months ago

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:

 

  1. Create a project called Interest
  2. Create a form with the following:
    1. Three text boxes labeled Principal, Interest Rate, and Years
    2. A tall label field
    3. A button labeled calculate
  3. When the user clicks the button, your program should do the following
    1. Compute value of the account for each year from year 0 to the the year entered in the Years text box.
    2. 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  
 
Loop   4  
Calculation   3  
Output   4  
Total   15  

 

Notes

 
 
 
 
 
 

 

 

 

Comments (0)

You don't have permission to comment on this page.