Question
Write a program in java to do the following. Assume that at the start of year 1, a person deposits 1000 into a savings account.
Write a program in java to do the following. Assume that at the start of year 1, a person deposits 1000 into a savings account. At the end of the year, the bank adds 5% interest to the amount on deposit, giving 1050. At the end of the second year, the bank adds another 5% of the amount that has been on deposit, making the account 1102.50. This continues for 20 years. Write a program which uses a loop to calculate the year number (1, 2, .., 20) and the account amount for each year. The program should print the year number and the amount at the end of that year for each of the 20 years.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started