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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education