Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 23. Savings Account Balance. Write a program that calculate the balance of a savings account at the end of a three-month period. It should

Exercise 23. Savings Account Balance.
image text in transcribed
Write a program that calculate 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 balance Using Files-Total and Average Rainfall Write a program that reads in from a file a starting month name, an ending month name, and then the monthly rainfall for each month during that period. As it does this, it should sum the rainfall amounts and then report the total rainfall and average rainfall for the period. For example, the output might look like this: During the months of March-June the total rainfall was 7.32 inches and the average monthly rainfall was 1.83 inches. Data for the program can be found in the Rainfall.txt file. Write a program that calculate 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 balance Using Files-Total and Average Rainfall Write a program that reads in from a file a starting month name, an ending month name, and then the monthly rainfall for each month during that period. As it does this, it should sum the rainfall amounts and then report the total rainfall and average rainfall for the period. For example, the output might look like this: During the months of March-June the total rainfall was 7.32 inches and the average monthly rainfall was 1.83 inches. Data for the program can be found in the Rainfall.txt file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

How does the data model determine which table is the date table?

Answered: 1 week ago