Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can You solve this code and show the uml if that possible. Submission: Class Lab6 This class will contain method main which will contain the

can You solve this code and show the uml if that possible.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Submission: Class Lab6 This class will contain method main which will contain the menu of choices of actions. Class Person: This class will contain common data members for a person - firstName, lastName, phone Number, emailAddress. Methods: O constructor () to create accHolder object. Required getters O Interface Bank Simulator: This interface will contain the following methods Methods: O toString():String - returns the data of the account formatted to display o addBankAccount(): boolean - prompts the user to enter data for this object from keyboard and doesn't allow the user to continue with bad data o updateBalance (double) - updates the balance in the object by the parameter amount Abstract Class BankAccount: . This abstract class will implement the Bank Simulator interface. It will be the base class and contain the common data members for all Bank Accounts (i.e., accountNumber, accHolder, balance). Here, accHolder is an object of class Person. Methods: toString():String - returns the data of the account formatted to display addBankAccount(): boolean - prompts the user to enter data for this object from keyboard and doesn't allow the user to continue with bad data updateBalance (double) - updates the balance in the object by the parameter amount monthlyAccountUpdate() - processes the object with monthly update (make it abstract for base class.) O Class Savings Account: This class will be inherited from BankAccount and contains the data members for a savings account (i.e. double interestRate, double minimumBalance) Methods: o toString(): String - returns the data of the account formatted to display o addBankAccount(): boolean - prompts user to enter data for this object from keyboard and doesn't allow user to continue with bad data monthlyAccountUpdate() - processes the object with monthly update of adding interest (as long as bank balance is more than minimumBalance, else display error message) Class ChequingAccount: . This class will be inherited from BankAccount and contains the data members for a chequing account (i.e. double fee) Methods: o toString(): String - returns the data of the account formatted to display o addBankAccount(): boolean - prompts user to enter data for this object from keyboard and doesn't allow the user to continue with bad data monthly AccountUpdate() - processes the object with monthly update of deducting the fee (as long as the bank balance is more than fee, else displays error message) o Class Bank: This class will contain the array of BankAccount objects (which are instantiated with either SavingsAccount or ChequingAccount objects). Methods: o constructor) o addAccount:boolean - success add or not; prompts user to enter data for an account which is added to array - either chequing or savings account is added displayAccount() - String - prompts user to enter an account number to display, then returns data formatted to display or an error message. This should use toString() from BankAccount class. printAccountDetails() - prints details of all accounts update Account() prompts user to enter which account number to update, and by how much and then updates the balance appropriately - returns success message or error message findAccount() :int - prompts user to enter which account number they wish to find and returns array index of where it is found otherwise returns -1 o monthly Update() process through each current account in the array and updates the balance appropriately Format your code with proper indentation and formatting. Your code should be properly commented. Sample Output: Welcome to the Banking Simulation Program ======= a: Add new account u: Update an account d: Display an account P: Pzint all accounts m: Run monthly update q: Quit Enter your option: Enter details of Account Holder 1 Please select the type of account you wish to add. Type (without quotations) 'C' for chequing account or 'g' for savings account : s Enter account number (up to 8 digits) : 11111111 Enter first name of account holder : Rejaul Enter last name of account holder : Chowdhury Enter phone number of account holder : 6131231234 Enter email of account holder : re@gmail.com Enter opening balance of account holder : 1000 Enter the Saving Account's minimum balance : 200 Enter the Saving Account's yearly interest rate (should be a number in (0,1)): 0.2 a: Add new account u: Update an account d: Display an account P: Print all accounts m: Run monthly update q: Quit Enter your option

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions