Question: Problem Statement: Create the UML diagram and implement Account class that contains: A private int data field named acctNumber for the account ( default 0
Problem Statement:
Create the UML diagram and implement Account class that contains:
A private int data field named acctNumber for the account default
A private double data field named balance for the account default
A private Date data field named dateCreated that stores the date when the account was created
A noarg constructor that creates a default account
A constructor that creates an account with the specified number and initial balance
The accessor and mutator methods for the data fields acctNumber & balance
The accessor method for dateCreated
A void method named withdraw that withdraws a specified amount from the account
A void method named deposit that deposits a specified amount to the account
A String method named toString that displays the date the account is created
Create the UML diagram and implement CheckingAccount, subclass of Account, that contains:
A private static data field named overdrawLimit for the account default
A noarg constructor that creates a default account
A constructor that creates an account with the specified acctNumber and initial balance
The accessor methods for overdrawLimit
override toString to display "Checking"
Create the UML diagram and implement SavingsAccount, subclass of Account, that contains:
A private static data field named overdrawLimit for the account default
A noarg constructor that creates a default account
A constructor that creates an account with the specified acctNumber and initial balance
The accessor methods for overdrawLimit
override toString to display "Savings"
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 invokes their toString methods.
Your program should do the following :
start
Create an Account object
Display the description of the object
Enter the Checking Account Number
Enter the Checking Account Balance
Enter the amount to withdraw
Create a Checking Account
Display the checking account balance
Withdraw from the checking account
Display the checking account balance
Enter the Savings Account Number
Enter the Savings Account Balance
Enter the amount to withdraw
Create a savings account
Display the description of the object
Display the savings account balance
Withdraw from the savings account
Display the savings account balance
end
Examples for a checking account and savings account are shown below: Note: User input is in bold after each prompt
created on Sat May :: PDT
Enter the Checking Account Number:
Enter the Checking Account Balance:
Enter the amount to withdraw:
Checking
Initial Ballance: $
Withdrawing $
Balance After Withdrawal: $
Enter the Savings Account Number:
Enter the Savings Account Balance:
Enter the amount to withdraw:
Savings
Initial Ballance: $
Withdrawing $
Balance After Withdrawal: $
Example:
Comment out the toString in the checking account, compile, & run again: Note: User input is in bold after each prompt
created on Sat May :: PDT
Enter the Checking Account Number:
Enter the Checking Account Balance:
Enter the amount to withdraw:
created on Sat May :: PDT
Balance:
Initial Balance: $
Withdrawing: $
Balance After Withdrawal:$
Enter the Savings Account Number:
Enter the Savings Account Balance:
Enter the amount to withdraw:
Savings
Initial Ballance: $
Withdrawing $
Balance After Withdrawal: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
