Directions: Create a C program that will display the following requirements. (Filename : FinalExam) Every savings account has an associated interest rate, and annually ( assuming we have an annual rate), the rate is multiplied with the current balance to get the amount earned as interest. The amount is added to the current balance to get the new balance. For example, suppose we have an initial balance of P100,000.00 deposited at an interest rate of 10%. After one year, the savings account earns P10,000.00 (that's 10% of P100,000.00 ). so the new balance would be P110,000.00. After another year it earns P 11,000.00 (10% of P110,000.00) and the balance would be P121,000.00. Another year would make it P133,100.00 ( P121,000.00 + P12,100.00). Write a program that outputs the interest earned and balance of a savings account each year for several years. The program prompts for the following values: 1.) Initial Balance 2) Interest rate in decimal 3) Year deposited 4) Year to be withdrawn ********************************************************************************************************************* Sample Output: Initial Balance: 100000 Interest rate:: 0.10 Initial Year: :2020 Final Year : :2030 Year Interest Balance 2020 0 100000 2021 100000 110000 2022 110000 121000 2023 121000 133100 2024 133100 146410 2025 146410 161051 2026 161051 177156.1 2027 177156.1 194871.71 2028 194871.71 214358.88 2029 214358.88 235794.77 2030 235794.77 259374.25 Sample Output 2: Initial Balance:5000 Interest rate:0.5 Initial Year:1990 Final Year:1995 Year Interest Balance 1990 0 5000 1991 5000 7500 1992 7500 11250 1993 11250 16875 1994 16875 25312.5 1995 25312.5 37968.75 Note : Round off values to 2 decimal places.
Directions: Create a C program that will display the following requirements. (Filename : FinalExam)
Every savings account has an associated interest rate, and annually ( assuming we have an annual rate), the rate is multiplied with the current balance to get the amount earned as interest. The amount is added to the current balance to get the new balance.
For example, suppose we have an initial balance of P100,000.00 deposited at an interest rate of 10%. After one year, the savings account earns P10,000.00 (that's 10% of P100,000.00 ). so the new balance would be P110,000.00. After another year it earns P 11,000.00 (10% of P110,000.00) and the balance would be P121,000.00. Another year would make it P133,100.00 ( P121,000.00 + P12,100.00).
Write a program that outputs the interest earned and balance of a savings account each year for several years. The program prompts for the following values:
1.) Initial Balance
2) Interest rate in decimal
3) Year deposited
4) Year to be withdrawn
*********************************************************************************************************************
Sample Output:
Initial Balance: 100000
Interest rate:: 0.10
Initial Year: :2020
Final Year : :2030
Year Interest Balance
2020 0 100000
2021 100000 110000
2022 110000 121000
2023 121000 133100
2024 133100 146410
2025 146410 161051
2026 161051 177156.1
2027 177156.1 194871.71
2028 194871.71 214358.88
2029 214358.88 235794.77
2030 235794.77 259374.25
Sample Output 2:
Initial Balance:5000
Interest rate:0.5
Initial Year:1990
Final Year:1995
Year Interest Balance
1990 0 5000
1991 5000 7500
1992 7500 11250
1993 11250 16875
1994 16875 25312.5
1995 25312.5 37968.75
Note : Round off values to 2 decimal places.
You can try other input also. Balance, rate, initial year and final year.
Step by step
Solved in 2 steps with 1 images