The (fictitious) company Let Me Retire has asked you to build a financial calcul
ID: 3638753 • Letter: T
Question
The (fictitious) company Let Me Retire has asked you to build a financial calculator that can be used to calculate the future value of a retirement account. In its simplest form, a retirement account is, essentially, an annual deposit in an interest-bearing account. Deposits are always made at the beginning of the year and the interest earned is based on the balance each year.For example, suppose you deposit $100.00 per year for two years in a 10% retirement account. In the first year you will earn $10.00 interest (i.e., 10% of $100.00) giving you a balance of $110.00 at the end of year 1. Then, at the beginning of year 2 you will deposit another $100.00, giving you a balance of $210.00. So, in the second year you will earn $21.00 interest (i.e., 10% of $210.00) giving you a balance of $231.00 at the end of year 2.
Required Program Structure and Function
Your application must consist of single function named main(). When executed, your application must:
1. Print a header.
2. Prompt the user to enter the size of the annual deposit.
3. Prompt the user to enter the interest rate.
4. Prompt the user to enter the number of years until retirement.
5. Calculate the future value of the retirement account (when the user retires).
6. Print the future value of the retirement account.
Explanation / Answer
hope this help
the output
Header you want, Welcom
enter the size of the annual deposit
100000
enter the interest rate
10
enter the number of years until retirement
2
annual deposit 100000, interest rate 10, number of years 2f
uture value of the retirement account: 231000
Press any key to continue . . .
==================
Module Module1
Sub Main()
Console.WriteLine("Header you want, Welcom ")
Console.WriteLine("enter the size of the annual deposit")
Dim Deposit As Double
Deposit = Console.ReadLine()
Console.WriteLine("enter the interest rate")
Dim rate As Double
rate = Console.ReadLine()
Console.WriteLine("enter the number of years until retirement")
Dim years As Integer
years = Console.ReadLine()
Console.WriteLine("annual deposit {0}, interest rate {1}, number of years {2}", _
Deposit, rate, years)
Dim result As Double = 0
For index As Integer = 1 To years
result += Deposit
result += result * (rate / 100)
Next
Console.WriteLine("future value of the retirement account: {0}", result)
End Sub
End Module
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.