Write a compound interest calculator. The compound interest formula is: Where: P
ID: 3772356 • Letter: W
Question
Write a compound interest calculator. The compound interest formula is:
Where:
P = principal amount (the initial amount you borrow or deposit)
r = annual rate of interest (as a decimal)
t = number of years the amount is deposited or borrowed for.
A = amount of money accumulated after n years, including interest.
n = number of times the interest is compounded per year
Here is a link to a site that explains how compound interest is calculated:
http://ncalculators.com/interest/compound-interest-calculator.htm
Specifications:
Explanation / Answer
Private Sub btnCalculate_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnCalculate.Click
Dim principal, years As Integer
Dim rate, interest, amount As Single
principal = txtPrincipal.Text
years = txtYears.Text
rate = txtRate.Text
amount = principal * Math.Pow((1 + rate / 100), years)
interest = amount - principal
txtInterest.Text = interest
End Sub
Private Sub btnClear_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnClear.Click
txtPrincipal.Text = " "
txtYears.Text = " "
txtRate.Text = " "
txtInterest.Text = " "
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnExit.Click
End
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.