(Latest Revision: Tue Mar 13 20:33:53 PDT 2012 )
john@lucifer: a.out This program will determine how many times one can withdraw P dollars from an account earning interest rate R, assuming the initial value of the account is S dollars. You will be prompted to enter S, P, and R, (in that order). and then the number of monthly payments possible will be calculated and written to the screen. You must now enter the amount of the initial principal sum, S, in the account, in decimal form (for example: 257823.21). Do *not* include any commas.) Enter S, the amount of the initial principal sum here ==> S = 257823.21 You must now enter the amount of the monthly payment P in decimal form (for example: 1554.55). Do *not* include a dollar sign ($). Do *not* include any commas. Enter P, the amount of the monthly payment here ==> P = 1554.55 Now you must enter the annual interest rate in decimal form (for example: 4.125). Do *not* include a percent sign (%). Do *not* include any commas. Enter R, the annual interest rate here ==> R = 4.125 Here is your answer: $257823.21 will run out after approximately 246 months, assuming that an annual interest of 4.125% is earned, compounded monthly, and a monthly payment of $1554.55 is withdrawn immediately after each interest payment. john@lucifer: a.out This program will determine how many times one can withdraw P dollars from an account earning interest rate R, assuming the initial value of the account is S dollars. You will be prompted to enter S, P, and R, (in that order). and then the number of monthly payments possible will be calculated and written to the screen. You must now enter the amount of the initial principal sum, S, in the account, in decimal form (for example: 257823.21). Do *not* include any commas.) Enter S, the amount of the initial principal sum here ==> S = 257823.21 You must now enter the amount of the monthly payment P in decimal form (for example: 1554.55). Do *not* include a dollar sign ($). Do *not* include any commas. Enter P, the amount of the monthly payment here ==> P = 1554.55 Now you must enter the annual interest rate in decimal form (for example: 4.125). Do *not* include a percent sign (%). Do *not* include any commas. Enter R, the annual interest rate here ==> R = 8.25 The money will never run out. john@lucifer: