Need to be explained operator overloading in detail. - 28753

Request Posted by


Earned: $21.25
Request Detail
Price: $20
  • From: Computer Science, Programming
  • Due on: Fri 18 Oct, 2013 (02:28pm)
  • Asked on: Fri 18 Oct, 2013
  • Due date has passed, but you can still Post Solution.

Design a class of type family and define an object from this class.

  1. Include in the class:

    • ?  private members of strings for husband, wife, son, daughter1, daughter2, and a pointer to family. (Hint regarding the private pointer to family: All you are doing is making a pointer to a class family. By making it private you are deciding that you cannot change the class.)

    • ?  public void function without arguments called initialize.

    • ?  void friend function called output with a pointer to family as an


  2. Declare a void function prototype (that will be used for output) for output. Have the output function output on the screen husband is xxxx, wife is xxxx, son is xxxx, daughter1 is xxxx, and daughter2 is xxxx on separate lines. (The xxxx are the respective names used in initialize below.)

  3. Declare a family type object called Simpson.

  4. Include all of the above in a function that uses the public function initialize in Simpson to initialize the pointer to the address of Simpson, and initializes husband as "Donald Simpson," wife as "Shirley Simpson," son as "Horatio Simpson," daughter1 as "Harriet Simpson," and daughter2 as "Hillary Simpson." Also include in the public function family:



initialize the output function.

V. Run the program. Explain in a comment at the top of your program why the program would not work as is if the output function was private and not a friend. 

2 Solution for Need to be explained operator overloading in detail.
Title Price Category solution By purchased  
Explanation for operator overloading assignment
$20.00 no category sarmad_junaid 1 time(s)
class file with explaination
$20.00 no category BestAnswer 0 time(s)
Please Login or Register to Submit the Solution for the Request