Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write in java STAGE 1 : ( The Account class ) Design a class named Account.java that contains: A protected int data field named id
write in java STAGE : The Account class Design a class named Account.java that contains: A protected int data field named id for the account default A protected double data field named balance for the account default A protected Date data field named dateOpened that stores the date when theaccount was created. A noarg constructor that creates a default account. A constructor that creates an account with a given account id balance, and sets thedateOpened to current date. The accessor and mutator functions for id and balance. A accessor method to return dateOpened. 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 to return a string in following format:Account id: Account opened:Balance: $Account.java# id : int# balance : double# dateOpened : Date Account Accountid:int, balance:dounle getId: int getBalance: double setIdid:int : void setBalancebalance:double : voidgetDateOpened: Date withdrawamount:double :void depositamount:double : void toString: stringSTAGE : Derived classes of Account In Stage the Account class was created to model a bankaccount. An account has the properties account number, balance, and methods to deposit andwithdraw.Create two derived classes for checking and saving accounts.SATGE : The Checking class Design a subclass of Account called Checking.java that contains: A double data field named overdraftLimit. A checking account has an overdraft limit $ andacquires no interest. Define and override withdraw methods. Define and override the toString function to return a string in the following format:CheckingsAccount id: Account opened:Balance: $NOTE: Checking account cannot be overdrawn more than overdraftLimit. Reset balance.Checkings.java# overdraftlimit : double default is Checkings Checkingsid:int, balance:double withdrawamount:double : void toString:stringSATEG : The Saving class Design a subclass of Account called Saving.java that contains: A data filed named annualInterestRate. The accessor and mutator functions for annualInterestRate. A function named getMonthlyInterest that returns the monthly interest. Define and override the toString function to return a string in the following format:SavingsAccount id: Account opened:Balance: Interest Rate: NOTE: Saving account cannot be overdrawn. Reset balanceSavings.cpp# annualInterestRate : double SavingsSavingsid:int, balance:double,rate:double getAnnualInterestRate: double setAnnualIntersetRaterate:double : void getMonthlyInterest: double withdrawamount:double : void toString: string Implement the classes Use MyBank.java driver program to test your classes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started