//This program calculates the balance of a savings account over a period of time.   Module main ()   Call showMsg ()   Call user_input ()   Call monthly_calculations (ref Integer monthsPassed)   Call displayOutput ()   End module     //This displays an explanation to the end user about what this program does   Module showMsg ()   Display “This program calculates your savings account balance, number of deposits, ”   Display “number of withdrawals, and total interest earned over time.”   End module     //This module asks the user for the starting balance, annual interest rate, and   //the amount of months since the account opened and stores the   //users input in their corresponding variables   Module user_input ()   Declare Real annual_interest_rate, balance   Declare Integer monthsPassed Display “What is your account's starting balance?”   Input balance   Display “Please enter the annual interest rate for your account.” Input annual_interest_rate   Display “How many months have passed since your account was established?”   Input monthsPassed   End module     // This module does all the calculations of the program   //using a do-while statement of the amount withdrawn into the account and the   //balance and also calculates the interest rate which is multiplied by the balance.   Module monthly_calculations ()   Declare Real monthlyDeposit, monthlyWithdrawal, interest   Declare Real totalDeposit = 0, totalWithdrawal = 0   Declare Integer months = 1   Do   Display “How much money did you deposit in month “, months, “?”   Input monthlyDeposit   Set balance = balance + monthlyDeposit   Set totalDeposit = totalDeposit + monthlyDeposit    Display “How much money did you withdraw from your account in month “, months “?”   Input monthlyWithdrawal   Set balance = balance – monthlyWithdrawal   While months <= monthsPassed   Set interest = (annual_interest_rate /12) * balance   Set balance = balance + interest   End module     // The output is presented to the end user, and they find out the total amounts that have   //been deposited, withdrawn from the account as well as the interest earned.   //This is also the last module that is called so it returns to the main module and the program stops   //execution.   Module displayOutput ()   Display “Since opening your account: “   Display “Your total savings account balance is $”, balance , “.”   Display “The total amount you have deposited is $”, totalDeposit , “.”   Display “The total amount you have withdrawn is $”, totalWithdrawal , “.”   Display “The total interest you have earned is $”, interest , “.” End module  Program analysis, flowchart and a hierarchy chart please thanks.

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

//This program calculates the balance of a savings account over a period of time.  

Module main ()  

Call showMsg ()  

Call user_input ()  

Call monthly_calculations (ref Integer monthsPassed)  

Call displayOutput ()  

End module  

 

//This displays an explanation to the end user about what this program does  

Module showMsg ()  

Display “This program calculates your savings account balance, number of deposits, ”  

Display “number of withdrawals, and total interest earned over time.” 

 End module  

 

//This module asks the user for the starting balance, annual interest rate, and  

//the amount of months since the account opened and stores the  

//users input in their corresponding variables  

Module user_input ()  

Declare Real annual_interest_rate, balance  

Declare Integer monthsPassed Display “What is your account's starting balance?”  

Input balance  

Display “Please enter the annual interest rate for your account.” Input annual_interest_rate  

Display “How many months have passed since your account was established?”  

Input monthsPassed  

End module  

 

// This module does all the calculations of the program 

 //using a do-while statement of the amount withdrawn into the account and the 

 //balance and also calculates the interest rate which is multiplied by the balance.  

Module monthly_calculations () 

 Declare Real monthlyDeposit, monthlyWithdrawal, interest  

Declare Real totalDeposit = 0, totalWithdrawal = 0  

Declare Integer months = 1 

 Do  

Display “How much money did you deposit in month “, months, “?” 

 Input monthlyDeposit  

Set balance = balance + monthlyDeposit  

Set totalDeposit = totalDeposit + monthlyDeposit  

 Display “How much money did you withdraw from your account in month “, months “?”  

Input monthlyWithdrawal  

Set balance = balance – monthlyWithdrawal  

While months <= monthsPassed  

Set interest = (annual_interest_rate /12) * balance  

Set balance = balance + interest  

End module  

 

// The output is presented to the end user, and they find out the total amounts that have  

//been deposited, withdrawn from the account as well as the interest earned.  

//This is also the last module that is called so it returns to the main module and the program stops  

//execution.  

Module displayOutput ()  

Display “Since opening your account: “ 

 Display “Your total savings account balance is $”, balance , “.” 

 Display “The total amount you have deposited is $”, totalDeposit , “.”  

Display “The total amount you have withdrawn is $”, totalWithdrawal , “.”  

Display “The total interest you have earned is $”, interest , “.” End module 

Program analysis, flowchart and a hierarchy chart please thanks.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
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
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