Question: Person class Instance variables: firstName(String), lastName(String), email(String), phoneNumber (long) Constructor: as required Methods: getters that return name, email and phone number. Name should be returned



Person class Instance variables: firstName(String), lastName(String), email(String), phoneNumber (long) Constructor: as required Methods: getters that return name, email and phone number. Name should be returned as one string. If first name is John and last name is Doe", getter should return "John Doe. readPersonalDetails(): Accepts a Scanner object, returns nothing. Reads first name, last name, email and phone number and stores in corresponding variables. Account class (abstract) Instance variables: accNumber (long), accHolder (Person), balance (double) Constructor: as required Methods: 1. readAccount Details (): accepts Scanner object, returns nothing. Reads accNumber, invoke readPersonalDetails() to read personal details, and reads balance. 2. displayAccount (): accepts nothing, returns nothing. This method prints details of an account using formatted output (use printf). 3. updateBalance(): can we write any lines of code in this??? Otherwise, make this method abstract. Savings class (extends Account) Instance variables: interestRate (double) which is the yearly interest rate. Constructor: initializes interestRate with 3.99 Methods: updateBalance(): accepts nothing, returns nothing. Calculate the new balance by adding monthly interest Bank class Instance variables: name (String) which is the name of the bank, and an array named accounts, which is an array of Account objects Constructor: parameterized constructor that gets name and size as parameters. This constructor sets the name of the Bank and creates the array of accounts with the given size (name and size will be read in main(), and will be sent here when creating the Bank object) Methods: 1. readAccounts(): accepts Scanner object, returns nothing. In a for loop, read details of all accounts. First, read the type of the account. Based on the type of the account, corresponding array object needs to be created (Polymorphism). Then, call readAccount Details() method. 2. runMonthlyProcess(): accepts nothing, returns nothing. Invokes updateBalance() for all accounts 3. displayAccounts(): accepts nothing, returns nothing. In a for loop, call display Account() to print details of all accounts. 4. printStar(): static method that prints a line using "*". Use for loop to print many stars. 5. printTitle(): static method that prints the title of the output.printStar() method will be called from this method to print lines. (Check Expected Output to see the format of the title) BankTest class This is the driver class (test class), which means this class has the main method. Main method This method read the name of the bank (example: Quality") and the number of accounts (stored in num). A Bank object will be created with the name and num. Read details of all accounts Run the monthly process on all accounts Print the title and the header row Display details of all accounts. Format your code with proper indentation and formatting. Your code should be properly commented
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
