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 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 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 balanc

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.6: Nested Loops
Problem 1E: (Misc. application) Four experiments are performed, and each experiment has six test results. The...
icon
Related questions
Question

ctt code 

 

Test Casel:
Welcome to Your Bank!
What is your starting Balance? $100
What is the annual interest rate?. Please enter whole value. For example 6 for 68 :6
Month #1
Current Balance: $100.00
Please enter total amount of deposits: $2000
Please enter total amount of withdrawals: $200
New Balance: $1905.00
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
Start Balance:
$100.00
$9000.00
$4200.00
Total Deposits:
Total Withdrawals:
Total Interest Earned: $36.61
Final Balance:
$4936.61
Transcribed Image Text:Test Casel: Welcome to Your Bank! What is your starting Balance? $100 What is the annual interest rate?. Please enter whole value. For example 6 for 68 :6 Month #1 Current Balance: $100.00 Please enter total amount of deposits: $2000 Please enter total amount of withdrawals: $200 New Balance: $1905.00 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 Start Balance: $100.00 $9000.00 $4200.00 Total Deposits: Total Withdrawals: Total Interest Earned: $36.61 Final Balance: $4936.61
DESCRIPTION
write a program for the following exercises 23 at the end of the chapter on loops. Here is the description of
that exercise.
23. 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 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 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 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 balanc
Transcribed Image Text:DESCRIPTION write a program for the following exercises 23 at the end of the chapter on loops. Here is the description of that exercise. 23. 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 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 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 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 balanc
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Fundamentals of Input and Output Performance
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr