//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.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
//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.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images