Develop and implement a class
Account that represents a savings account. An
Account object should have three attributes: the name of the account, the owner of the account, and the current balance. The class should provide the following constructors behaviors.
Name(): configures a new account with name "name", owner "owner", and balance 0.
Name(String s, String t,
double n): configures a new account with name s, owner t, and balance n.
void deposit(
double n): adds amount n to the current balance of the associated account.
void withdraw(
double n): subtracts amound n from the current balance of the associated account.
void close():zeroes out the account balance, sets the owner to "".
String getAccountName(): returns the name of the associated account.
String getOwner(): returns the owner of the associated account.
double getBalance():returns the balance of the associated account.
void setName(String s): sets the name of the associated account to s.
void setOwner(String s): sets the owner of the associated account to s.
String toString(): returns a textual representation of the attributes of the associated account.
Bookmarks