Write a program, named Y ourFirstNameLastNameProg1 , that calculates the balance of a savings account at the
Question:
Write a program, named YourFirstNameLastNameProg1, that calculates the balance of a savings account at the end of a period of time. It should ask the user for the monthly interest rate, the starting balance, and the number of months that have passed since the account was established. A loop should then iterate once for every month, performing the following:
- Complete the top documentation, as indicated in examples given in WEEK TWO
- Ask the user (one line) for the amount deposits for the month. (Do not accept negative numbers.) This amount should be added to the ending balance.
- Ask the user (one line) for the amount withdrawals for the month. (Do not accept negative numbers.) This amount should be subtracted from the ending balance.
- Ask the user (one line) for the monthly interest rate, in percentage.
- Convert the monthly interest rate from percentage to decimal to use for calculation.
- Multiply the monthly interest rate by the ending balance, and add the result to the ending balance.
- After the last iteration, the program should display the ending balance, the total amount of deposits, the total amount of withdrawals, and the total interest earned, in the following format:
Total amount of deposits: $
Total amount of withdrawals: $
Total interest earned: $
Ending Balance: $
NOTE: If a negative ending balance is calculated at any point, a message should be displayed indicating the account has been closed and the loop should terminate.
Please make sure to use the format and programming style illustrated by the author in the textbook.
Be consistent with the coding structures illustrated in the current textbook, covered in this course
Analysis Synthesis And Design Of Chemical Processes
ISBN: 9780134177403
5th Edition
Authors: Richard Turton, Joseph Shaeiwitz, Debangsu Bhattacharyya, Wallace Whiting