//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.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter5: Looping
Section: Chapter Questions
Problem 11PE
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning