Question: - design a class named account with the following fields - create CheckingAccount and SavingsAccount classess as subclasses of the Account class - write a

 - design a class named account with the following fields -

- design a class named account with the following fields

- create CheckingAccount and SavingsAccount classess as subclasses of the Account class

- write a test program called BankAccounts.java that creates objects of Account, SavingsAccount, and CheckingAccount invokes their toString() methods

create CheckingAccount and SavingsAccount classess as subclasses of the Account class -- code output should look like the picture above

- Draw the UML diagram for a class named Account and its two subclasses for CheckingAccount and SavingAccount in BankAccounts.docx - Use Figure 11.1 as an example - Create an account class titled BankAccounts.java - Include the code for CheckingAccount, SavingAccount classes, and the main class titled BankAccounts in BankAccounts java Submission Instruction - Submit BankAccounts.docx file. - Submit Accounts.java file - Submit BankAccounts.java file Problem Statement: Design and implement a class named Account that contains: A private int data field named id for the account (default 0 ) A private double data field named balance for the account (default 0) A private double data field named annualinterestrate that stores the current interest rate (default o) Assume all accounts have the same interest rate A private Date data field named datecreated that stores the date when the account was created A no-arg constructor that creates a default account A constructor that creates an account with the specified id and initial balance The accessor and mutator methods for id, balance, and annualinterestrate The accessor method for datecreated A method named getmonthlyInterestrate() that returns the monthly interest rate A method named getmonthlyInterest() that returns the monthly interest A method named withdraw() that withdraws a specified amount from the account A method named deposit() that deposits a specified amount to the account A method named tostring() that displays the date the account is created Note: The method getmonthlyInterest() is to return monthly interest, not the interest rate. Monthly interest is balance * monthlyInterestrate monthlyInterestRate is annualinterestrate / 12 . AnnualinterestRate is a percentage, for example 4.5%. You need to divide it by 100. Create CheckingAccount and SavingsAccount classes as subclasses of the Account class. Write a test program titled BankAccounts. java that creates objects of Account, SavingsAccount, and checkingAccount and inv okes their tostring() methods. Examples for a checking ccount and savings account are shown below: Note: User input is in bold after each prompt Create a checking account - ID =100 \& Balance =2000 Dsplay the description of the object withdraw 500 from the checking account Display the checking account balance Create a savings account - ID =200 \& Balance =5000 Dsplay the description of the object Withdraw 200 from the savings account Display the savings account balance Checkings 1500.0 saving 4800.0 Comment out the toString() in the cheking account, compile, \& run again: Note: User input is in bold after each prompt Create a checking account - ID =100&Balance=2000 Dsplay the description of the object Withdraw 500 from the checking account Display the checking account balance Create a savings account - ID =200 \& Balance =5000 Dsplay the description of the object Withdraw 200 from the savings account Display the savings account balance created on Sun Nov 0618:43:46 PST 2022 Balance: 2000.0 1500.0 Saving 4800.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!