Question: Please help me with my code I have gotten this so far #include #include using namespace std; int main() { double balance, interest_rate, interest, total_deposits

 Please help me with my code I have gotten this sofar #include #include using namespace std; int main() { double balance, interest_rate,

Please help me with my code I have gotten this so far

#include #include using namespace std; int main() { double balance, interest_rate, interest, total_deposits = 0, total_withdrawals = 0; int month; cout > balance; cout > interest_rate; double starting_balance = balance; double total_interest = 0; for (month = 1; month > deposit; } while (deposit > withdrawal; } while (withdrawal balance); total_withdrawals += withdrawal; balance -= withdrawal; interest = (month_starting + balance) / 2 * interest_rate / 12; balance += interest; total_interest += interest; } cout Lab: Problem Solving: Use appropriate loop construct (for, while, or do while) 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 the month. Do not accept negative numbers. This amount should be added to the balance. B) Ask the user for the total amount withdrawn from the account during that month. 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 month's 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 final report that includes the following information. - Starting balance at the beginning of the three-month period - Total deposits (money amount) made during the three-month period - Total withdrawals (money amount) made during the three-month period - Total interest posted to the account during the three months input values 0 0.5 0 0 1000 250 0 1000 800 760 output should look like this Input starting balance: Input annual interest rate: Month: 1 How much money was deposited this month? How much money was withdrawn this month? Month: 2 How much money was deposited this month? How much money was withdrawn this month? Month: 3 How much money was deposited this month? How much money was withdrawn this month? Please enter a number less than the balance of the account. How money was withdrawn this month? Total dep was How How bithdes balance: 21.6927

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!