Question

C++ Program Write an algorithm to settle the following question: A bank account starts out with...

C++ Program

Write an algorithm to settle the following question: A bank account starts out with $10,000. Interest is compounded monthly at 6 percent per year (0.5 percent per month). Every month, $500 is withdrawn to meet college expenses. After how many years is the account depleted?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Explanation:

while loop is used until balance of account becomes zero.

On every iteration, 500 dollars are deducted and 0.5 interest is added. Alongwith that, count variable keeps incrementing to count the months.


#include <iostream>

using namespace std;

int main()
{
float balance = 10000;
float interest = 0.5;
int count = 0;
while(balance>0)
{
balance = balance - 500 + (float)(balance*interest/100);
count++;
}
  
cout<<"Months: "<<count<<endl;
cout<<"Years: "<<(float)count/12<<endl;
return 0;
}

Output:

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!

Add a comment
Know the answer?
Add Answer to:
C++ Program Write an algorithm to settle the following question: A bank account starts out with...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program to produce a table that shows the balance of a bank account after...

    Write a program to produce a table that shows the balance of a bank account after each month, assuming that interest is compounded monthly and no additional money is added or withdrawn from the account. Consider this example to understand how this calculation can be done with a loop. Suppose you put $10,000 into an account with an annual percentage rate (APR) of 5.0%. After one month, the account would receive an interest credit of 10000 * 5.0 / 1200....

  • C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account...

    C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three month period. It should ask the user for the starting balance and the annual interest rate. A loop should then iterate once for every month in the period, performing the following A) Ask the user for the total amount deposited into the account during that month. Do not accept negative numbers. This amount should be added to the...

  • a) On 1 July 2017, $10,000 was deposited into an account earning interest at 4 percent...

    a) On 1 July 2017, $10,000 was deposited into an account earning interest at 4 percent per annum compounding monthly. $500 is to be withdrawn each month, commencing on 1 July 2018. How many full monthly withdrawals of $500 can be made? (4 marks)

  • i need this to be in OOP using C++ 25. Savings Account Balance Write a program...

    i need this to be in OOP using C++ 25. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three-month feried. It should ask the user for the starting balance and the annual interest rate. A loop abculd then iterate once for every month in the period, performing the following steps: B) A) Ask the user for the total amount deposited into the account during that month and add it...

  • Using the Design Recipe, write an algorithm for each of the following programming problems, showing all...

    Using the Design Recipe, write an algorithm for each of the following programming problems, showing all work (i.e., Contract, Purpose Statement, Examples and Algorithm): 5.Write a program that reads two times in military format (e.g., 0900, 1730) and prints the number of hours and minutes between the two times. Note that the first time can come before or after the second time. 6.An online bank wants you to create a program that shows prospective customers how their deposits will grow....

  • Taylor has a retirement account that pays 4% per year compounded monthly. Every month for 20...

    Taylor has a retirement account that pays 4% per year compounded monthly. Every month for 20 years, Taylor deposits $444, with the first deposit at the end of month 1 The day the last deposit is made, the interest rate increases to 6% per year compounded monthly. During retirement, Taylor plans to make equal monthly withdrawals for 15 years, thus depleting the account. The first withdrawal occurs one month after the last deposit. How much can be withdrawn each month?

  • $900 14.38. A foreign bank account pays 100% interest compounded monthly. (a) If a company deposits...

    $900 14.38. A foreign bank account pays 100% interest compounded monthly. (a) If a company deposits $50,000 each month, what will be in its bank account at the end of three years? (b) What is the effective annual interest, in percent? 14.39.* An elderly lady owns a home for which she has completely paid. She arranges a reverse mortgage for $100,000, whereby she will receive monthly payments for the home from a bank. She will be allowed to live in...

  • Infrastructure Economics 5) A set of cash revenues starts at $50,000 in the first year and...

    Infrastructure Economics 5) A set of cash revenues starts at $50,000 in the first year and increases each year until no15 years. If the interest rate is 7% (compounded annually), what is the present value of the cash flows if: A. The annual increase is $5,000 per year B. The annual increase is 10% per year 6) An investment of $10,000 is deposited in a bank account which pays 9% annual interest compounded monthly. How much will be in the...

  • 3) How much money should be invested at 8% per year so that after 2 years...

    3) How much money should be invested at 8% per year so that after 2 years the amount will be $10,000 when the interest is compounded monthly? 4) To save for his son's college education, Mr. Graff decides to put $50 aside every month in a credit union account paying 10% interest compounded monthly. If he begins this saving program when his son is 3 years old, how much will he have saved by the time his son is 18...

  • A woman, with her employers matching program, contribute $500 at the end of each month to...

    A woman, with her employers matching program, contribute $500 at the end of each month to her retirement account, which earn 6% interest, compounded monthly. When she retires after 42 years, she plans to make monthly withdrawals for 34 years. If your account is 4% interest, compounded monthly, then when she retires, what is her maximum possible monthly withdrawal (without running out of money)?

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT