Question
C++ Write a program that calculates the balance of a savings account at the end of a three- month period. It should ask the user
C++
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 steps: A) Ask the user for the total amount deposited into the account during that month and add it to the balance. Do not accept negative numbers. B) Ask the user for the total amount withdrawn from the account during that month and subtract it from the balance. Do not accept negative numbers or numbers greater than the balance after the deposits for the month have been added in. C) Calculate the interest for that month. The monthly interest rate is the annual interest rate divided by 12. Multiply the monthly interest rate by the average of that months starting and ending balance to get the interest amount for the month. This amount should be added to the balance. After the last iteration, the program should display a report that includes the following information: starting balance at the beginning of the three-month period total deposits made during the three months total withdrawals made during the three months total interest posted to the account during the three months final balance
Test Welcome to Your Bank! What is your starting Balance? $100 What is the annual interest rate?. Please enter whole value. For example 8 for 8% :7 Month #1 Current Balance: $50 Please enter total amount of deposits: $20 Please enter total amount of withdrawals: $200 New Balance: $----.- Month #2 Current Balance: $1905.00 Please enter total amount of deposits: $3000 Please enter total amount of withdrawals: $2000 New Balance: $2917.03 Month #3 Current Balance: $2917.03 Please enter total amount of deposits: $4000 Please enter total amount of withdrawals: $2000 New Balance: $4936.61
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