Problem 2 write Pseudocode for a program that calculates and displays a customer's bank balance at the end of a month. The customer's bank balance at the end of the month is the beginning bank balance + the total amount of monthly deposit made - the total amount of monthly withdrawals made + interest earned. The information the program will need to get from the user is the beginning bank balance, the amount of monthly deposits , the amount of monthly withdrawals, and the monthly interest rate. The program will need to calculate interest, do so using this formula: interest=interest rate (ending balance before taking interest into account). In other words, the program should calculate the interest earned based on the ending bank balance before adding interest to it. The program should display the ending bank balance on the screen.
Procedure BankBalanceCalculator()
print("Beginning bank balance : ");
beg_bal = read_input(); // take the beginning bank
balance from user
print("Total amount of monthly deposite made :
");
deposite = read_input(); // take the amount of monthly
deposits from user
print("Total amount of monthly withdrawals made :
");
withdrawals = read_input(); // take the amount of
monthly withdrawals from user
print("Monthly interest rate : ");
interest_rate = read_input(); // take the monthly
interest rate
transaction = beg_bal + deposite + withdrawals;
interest_earned = ( transaction * interest_rate ) /
100 ; // calculating earned monthly interest
ending_bal = transaction + interest_earned; //
calculating the ending bank balance
print("The ending balance : " , ending_bal); //
showing the ending bank balance to the screen
End BankBalanceCalculator
Java Version -
import java.util.Scanner;
public class BankBalanace {
public static void main(String[] args) {
System.out.println("\nBank Balance
Calculator\n");
Scanner ob=new
Scanner(System.in);
System.out.print(" The beginning
bank balance : ");
double
beg_bal,deposite,withdrawals,interest_rate,transactions,interest_earned,ending_bal;
beg_bal=ob.nextDouble();
System.out.print("\nTotal amount of
monthly deposite made : ");
deposite=ob.nextDouble();
System.out.print("\nTotal amount of
monthly withdrawals made : ");
withdrawals=ob.nextDouble();
System.out.print("\nMonthly
interest rate : ");
interest_rate=ob.nextDouble();
transactions=beg_bal+deposite-withdrawals;
interest_earned=(transactions *
interest_rate)/100;
ending_bal=transactions+interest_earned;
System.out.println("\nThe ending
balance : "+ending_bal);
ob.close();
}
}
Get Answers For Free
Most questions answered within 1 hours.