pls write psuedocode
write UML CODE
ALSO
example 3 files 1 for abstract 1 for bank account and 1 for savings accounts due in 12 hours
import java.awt.HeadlessException; import java.text.DecimalFormat; import javax.swing.JOptionPane; public class Main { public static class SavingsAccount extends BankAccount { protected boolean isActive = (super.balance > 25); // Constructors public SavingsAccount() { super(); } public SavingsAccount(double balance, double annualInterest) { super(balance, annualInterest); } public double getMonthlyCharge() { this.monthlyProcess(); return monthlyCharge; } // Monthly charge process. public void monthlyProcess() { if (super.numberOfWithdrawals > 4) { super.monthlyCharge += super.numberOfWithdrawals - 4; if (super.balance < 25) { this.isActive = false; } } } // Withdraw. public boolean withdraw(double amount) { if (isActive) { return super.withdraw(amount); } else { return false; } } // Deposit public boolean deposit(double amount) { super.deposit(amount); if ((!this.isActive) && super.balance > 25) { this.isActive = true; return true; } else { return false; } } public boolean getIsActive() { return isActive; } public void setActive(boolean isActive) { this.isActive = isActive; } } //Abstract class BankAccount public static abstract class BankAccount { protected double balance; protected int numberOfDeposits; protected int numberOfWithdrawals; protected double annualInterest; protected double monthlyCharge; // Constructor accepts annual interest and // the balance. public BankAccount(double balance, double annualInterest) { this.setAnnualInterest(annualInterest); this.setBalance(balance); } // Default constructor. public BankAccount() {} // Monthly charge process. public void monthlyProcess() { this.balance -= this.monthlyCharge; this.calcInterest(); this.monthlyCharge = 0; this.numberOfDeposits = 0; this.numberOfWithdrawals = 0; } // Calculate the interest. protected void calcInterest() { double monthlyInterestRate; double monthlyInterest; monthlyInterestRate = this.annualInterest / 12; monthlyInterest = this.balance * monthlyInterestRate; this.balance = this.balance + monthlyInterest; } // Withdraw. public boolean withdraw(double amount) { if ((this.balance > amount) && (amount > 0)) { this.balance -= amount; this.numberOfWithdrawals++; return true; } else { return false; } } // Deposit public boolean deposit(double amount) { if (amount > 0) { this.balance += amount; this.numberOfDeposits++; return true; } else { return false; } } // Accessors and mutators. public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } public int getNumDepositsThisMonth() { return numberOfDeposits; } public void setNumDepositsThisMonth(int numDepositsThisMonth) { this.numberOfDeposits = numDepositsThisMonth; } public double getAnnualInterest() { return annualInterest; } public void setAnnualInterest(double annualInterest) { this.annualInterest = annualInterest; } public double getMonthlyCharge() { return monthlyCharge; } public void setMonthlyCharge(double monthlyCharge) { this.monthlyCharge = monthlyCharge; } public boolean getIsActive() { // TODO Auto-generated method stub return (Boolean) null; } } public static void main(String[] args) { double balance = 0; double annualInterest = 0; String output; String input; DecimalFormat df = new DecimalFormat("#0.00"); do { try { output = "Enter your account balance $:"; input = JOptionPane.showInputDialog(output); balance = Double.parseDouble(input); if (balance < 0) { throw new NumberFormatException(); } break; } catch (HeadlessException e) { errorMsg(); } catch (NumberFormatException e) { errorMsg(); } } while (true); do { try { output = "Please enter your annual interest rate: \n" + "EXAMPLE: A 4% interst rate is 0.04"; input = JOptionPane.showInputDialog(output); annualInterest = Double.parseDouble(input); if (annualInterest < 0) { throw new NumberFormatException(); } break; } catch (HeadlessException e) { errorMsg(); } catch (NumberFormatException e) { errorMsg(); } } while (true); // Instantiate your object. BankAccount savings = new SavingsAccount(balance, annualInterest); do { try { output = "Enter the number of withdrawals:"; input = JOptionPane.showInputDialog(output); savings.numberOfWithdrawals = Integer.parseInt(input); if (savings.numberOfWithdrawals < 0) { throw new NumberFormatException(); } break; } catch (HeadlessException e) { errorMsg(); } catch (NumberFormatException e) { errorMsg(); } } while (true); do { try { output = "Enter the number of deposits:"; input = JOptionPane.showInputDialog(output); savings.numberOfDeposits = Integer.parseInt(input); if (savings.numberOfDeposits < 0) { throw new NumberFormatException(); } break; } catch (HeadlessException e) { errorMsg(); } catch (NumberFormatException e) { errorMsg(); } } while (true); // Add the interest to the balance: savings.calcInterest(); output = "Account Balance with Interest: $" + df.format(savings.getBalance()); output += "\nMonthly Charge that will be deducted: $" + df.format(savings.getMonthlyCharge()); output += "\nAccount Status: "; output += savings.getIsActive() ? "Is Active" : "Not Active"; JOptionPane.showMessageDialog(null, output); } private static void errorMsg() { String output; output = "Error: There was an error with your entry"; JOptionPane.showMessageDialog(null, output); } }
pls write psuedocode write UML CODE ALSO example 3 files 1 for abstract 1 for bank...
Must be in GUI interfaceDesign an abstract class namedBankAccountto hold the following data for a bankaccount:* Balance* Number of deposits this month* Number of withdrawals (this month)* Annual interest rate* Monthly service chargesThe class should have the following methods:Constructor: The constructor should accept arguments for the balance and annual interest rate.deposit: A method that accepts an argument for the amount of the deposit. The methods should add the argument to the account balance. It should also increment thevariable holding the...
Design and implement the following 3 classes with the exact fields and methods (these names and caps exactly): 1. An abstract class named BankAccount (java file called BankAccount.java) Description Filed/Method Balance NumberDeposits NumberWithdrawals AnnualInterestRate MonthlyServiceCharge BankAccount SetHonthlyServiceCharges A method that accepts the monthly service charges as an argument and set the field value GetBalance GetNum berDeposits GetNum berWithdrawals GetAnnualinterestRate GetMonthlyServiceCharge A method that returns the monthly service charge Deposit field for the bank account balance A field for the number...
please rewrite this code as Pseudo-Code,.. basically rewrite the code but in english language , Thank you so much! public abstract class BankAccount { //declare the required class variables private double balance; private int num_deposits; private int num_withdraws; private double annualInterest; private double serviceCharges; //constructor that takes two arguments // one is to initialize the balance and other // to initialize the annual interest rate public BankAccount(double balance,...
the programing language is C++ TIC PEO. Design a generic class to hold the following information about a bank account! Balance Number of deposits this month Number of withdrawals Annual interest rate Monthly service charges The class should have the following member functions: Constructor: Accepts arguments for the balance and annual interest rate. deposit: A virtual function that accepts an argument for the amount of the deposit. The function should add the argument to the account balance. It should also...
TASK 1 Create a new class called CheckingAccount that extends BankAccount. It should contain a static constant FEE that represents the cost of clearing onecheck. Set it equal to 15 cents. Write a constructor that takes a name and an initial amount as parameters. Itshould call the constructor for the superclass. It should initializeaccountNumber to be the current value in accountNumber concatenatedwith -10 (All checking accounts at this bank are identified by the extension -10). There can be only one...
solve this JAVA problem in NETBEANS Problem #12 in page 400 of your text (6th edition): SavingsAccount Class. Design a SavingsAccount class that stores a savings account's annual interest rate and balance. The class constructor should accept the amount of the savings account's starting balance. The class should also have methods for subtracting the amount of a withdrawal, adding the amount of a deposit, and adding the amount of monthly twelve. To add the monthly interest rate to the balance,...
C++ Simple code please Thank you in advance B. Write a C++ program as per the following specifications: a. Define the class BankAccount to store a bank customer's account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the account number, retrieve the account number, retrieve the balance, deposit and withdraw money, and print account information. Add appropriate constructors. b. Every bank...
Code should be in C# Create a class called SavingsAccount. Use a static variable called annualInterestRate to store the annual interest rate for all account holders. Each object of the class contains a private instance variable savingsBalance, indicating the amount the saver currently has on deposit. Provide method CalculateMonthlyInterest to calculate the monthly interest by multiplying the savingsBalance by annualInterestRate divided by 12 – this interest should be added to savingsBalance. Provide static method setAnnualInterestRate to set the annualInterestRate to a new value....