Question: Exercise ( 1 ) Write the full BankAccount class, knowing that: BankAccount ( account number : String, balance : double ) : constructor defines the
Exercise
Write the full BankAccount class, knowing that:
BankAccount account number : String, balance :
double : constructor defines the account number and the
starting balance.
This method updates all the static member variables. The
accounts count should be incremented, and the balance should be
added to the total balances.
BankAccountBankAccount other is a copy constructor.
withdraw amount : double : withdraws the specified
amount from the account.
If sufficient funds are available: the method updates the balance by
subtracting the amount, then sets last transaction type to
"Withdraw", and sets last transaction amount to the value of the
parameter amount'.
Otherwise, If the amount is not available, a warning message should
be displayed indicating that "the amount is not available".
This method updates the static variable 'total balances' by
subtracting the amount, if sufficient funds are available.
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
