/* In plain English: Create a class in a class and start with *head newclasshere. That class is going to have the bank data and functions. Submission instruction: for this homework, you only need to submit the electronic copy, i.e., the zip file, on iLearn. Due by: 11:55PM, Friday, November 21 Problem description: The source code posted under Week #11 implements a linked list of bank accounts in its simplest form. However, this program only implements each individual node as an object of the class BankAccountNode. Instead of implementing a linked list as an abstract data type (i.e., class), this program declares a linked list as a pointer (i.e., the head pointer) and then uses standalone functions to manipulate such a linked list. In this homework, you are required to implement such a linked list as an abstract data type listBankAccount, which consists of the following functions: * Initialization: define at least one constructor to initialize a linked list. // seems to be okay * frontInsert(): insert a node to the front of a list. // renamed, uncertain about implementation * endInsert(): insert a node to the end of a list. // renamed, uncertain about implementation * isEmpty(): check whether a list is empty. // not implemented anywhere. * searchAccount(): search whether a node is on the list given an account ID. // renamed, uncertain about implementation * updateAccount(): given an account ID, first search whether it exists on the list. If yes, update its checking balance as specified by a parameter. // not implemented anywhere. * deleteAccount(): given an account ID, first search whether it exists on the list. If yes, delete this node. // deleteLink might be related. I'm unsure. * printList(): print all the nodes on a list. // not implemented anywhere * destructor: release a linked list to the freestore. // Not implemented anywhere. Write a test driver to test your code. Note: you can reuse the source code posted on iLearn. */ #ifndef _BANKACCOUNT_NODE_ #define _BANKACCOUNT_NODE_ #include using namespace std; class BankAccountNode{ public: //constructors BankAccountNode(int id, double amt1, double amt2, BankAccountNode *nextNode); BankAccountNode(); //accessors int getId() const; double getChecking() const; double getSaving() const; BankAccountNode * getNext() const; //mutators void setAccount(int acctId, double amt1, double amt2, BankAccountNode *nextNode); void setId( int acctId ); void setAccount(double amt1, double amt2); void setChecking(double amt1); void setSaving(double amt1); void setNext(BankAccountNode * nextNode); //accessor void output() const; friend ostream& operator << (ostream& outputSrc, BankAccountNode &); private: int id; double checking; double saving; BankAccountNode *next; }; BankAccountNode *searchAccount(BankAccountNode *head , int acctId ); //NULL: does not exist; o.w.: the node int traverseLink( BankAccountNode *head ); //return: number of nodes or the length of a link BankAccountNode *frontInsert( BankAccountNode *head, BankAccountNode *newNode); //add a node to the front of the list BankAccountNode *endInsert( BankAccountNode *head, BankAccountNode *newNode); //add a node to the end of the list BankAccountNode * insertNode( BankAccountNode *head,BankAccountNode *newNode); //insert a node to an id-sorted list void deleteNode( BankAccountNode *head, int acctId ); //delete a node whose id=acctId void deleteLink( BankAccountNode *head ); #endif//#ifndef