If the parent's first name is Michael, the child's middle name should shortened to Mike
Note that for the formation of the child's middle name, only the first name of the parent is used, not the parent's middle name.
You should re-use the Composite pattern of the genealogical tree example but write another Visitor that updates people's names. You do not have to properly de-allocate the data structure after the program finishes.
Demonstrate the operation of your program by using the NamePrinter visitor to print the update names of all the people.
Hint: you need to add setFirstName() function to person class. You also need to modify the Composite class so that the first name is not constant
Enter option (i)nsert line (e)rase line (u)undo last command (c)heckpoint roll(b)ack (h)history (r)edo command:The functionality of the first five options is as in the example code. The two new options operate as follows. The program keeps the command history only from the time of the last checkpoint. In case a new checkpoint is taken, the history is purged.
1. erase line 2 2. erase line 3 3. insert "Hello, World!" at line 1
history listing command should not be retained in the list of commands. Neither should redo, only the original repeated command. For example, if the above history was listed, then second command is redone and then history listed again, then the history
1. erase line 2 2. erase line 3 3. insert "Hello, World!" at line 1 4. erase line 3
Note: Retaining pre-checkpoint history and implementing the requested functionality without using the Memento Design Pattern or Prototype Design Pattern is not allowed.
Milestone: Implement the "middle name" part of the assignment.