Question: c++ #include #include #include #include #include /mnt/ee259dir/tools/pro_3/sample_p3.h //#include sample_p3.h using namespace std; class P4_BANK: public P3_BANK{ public: // public methods for P4_BANK class P4_BANK(char *,
c++
#include
using namespace std;
class P4_BANK: public P3_BANK{ public: // public methods for P4_BANK class P4_BANK(char *, int); // constructor; // example usage: P4_BANK b(NAME, x); // create an object called b with x customers; name of the object is NAME assigned to objName var;
void P4_LIST(); // another method; // example usage: b.P4_LIST(); // inherit from P3_LIST; // returns no values;
int operator == (int); // an overloaded operator; // example usage: if (b1 == 4) // if there are 4 customers in object b1, return 1; // otherwise return 0;
int operator == (P4_BANK); // an overloaded operator; // example usage: if (b1 == b2) // return 1 if the number of customers in b1 is equal to number of customers in b2; // return 0 otherwise;
int operator -= (int); // an overloaded operator; // example usage: b1 -= 1234; // remove customer with id 1234 from b1 object, if it exists; // returns 1 if successful; // returns -1 if no such customer; // returns -2 if input error;
void operator = (P4_BANK); // an overloaded operator; // example usage: b1 = b2; // assign elements of b2 to b1; // b2 remains unchanged; // returns nothing;
P4_BANK operator + (P4_BANK); // an overloaded operator; // example usage: b1+b2; // step 1: create a temporary P4_BANK object (call it P4_TEMP); // step 2: copy elements of b1 into P4_TEMP; // step 3: append elements of b2 into P4_TEMP; // step 4: return P4_TEMP object; private: char objName[15]; // character string that holds object name; max 15 characters; }; P4_BANK::P4_BANK(char * oN, int x) : P3_BANK(x) // call base class constructor; DO NOT put semicolon at the end of this line { strcpy(objName, oN); // copy oN into objName;
o_f
void P4_BANK::P4_LIST() { // your code goes below: o_f
int P4_BANK::operator == (int x) { // your code goes below:
}
int P4_BANK::operator == (P4_BANK obj2) { // your code goes below: }
int P4_BANK::operator -= (int x) { // your code goes below: }
void P4_BANK::operator = (P4_BANK obj2) { // your code goes below: }
P4_BANK P4_BANK::operator + (P4_BANK obj2) { // your code goes below: P4_BANK P4_TEMP("P4_TEMP", 0);
return P4_TEMP; }




Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
