Question: Not sure how to complete this C++ program on recursive functions. This program includes a input file, noah_family.txt,which contains the following: Noah Shem Noah Japheth

Not sure how to complete this C++ program on recursive functions. This program includes a input file, "noah_family.txt",which contains the following:

Noah Shem

Noah Japheth

Noah Ham

Shem Arphaxad

Japheth Gomer

Japheth Magog

Japheth Madai

Japheth Tubal

Japheth Meshech

Japheth Tiras

Ham Cush

Ham Nimrod

Ham Phut

Ham Canaan

Arphaxad Shalah

As shown, the file contains a rather large family tree.

Requirement :

Use the attached input file to load data.

Add displayDescendants() as a public function to the Person class and call it from main() to display all descendants of Noah. (So in main() we no longer call dispalyChildren().)

/// What main() should look like.

int main() { Person Noah("Noah"); Noah.displayDescendants();

return 0; }

Output:

The output should be similar to the following display.

Father: Noah

Children: Shem, Japheth, Ham

Father: Shem

Children: Arphaxad

Father: Arphaxad

Children: Shalah

Father: Japheth

Children: Gomer, Magog, Madai, Tubal, Meshech, Tiras

Father: Ham

Children: Cush, Nimrod, Phut, Canaan

Not sure how to complete this C++ program on recursive functions. Thisprogram includes a input file, "noah_family.txt",which contains the following: Noah Shem Noah

Goal: 1. Learn how to use constructor to load data for the private data members, such as array or vector, of the class. These data are loaded into the objects by using "new" operators and the objects are linked by the array (or vector) pointers 2. Learn how to use destructor to release dynamically allocated memory Requirement: Use class, struct and vector to implement a family tree which is top part of the one below The Genealogy of Noah came to rest on Mt Arrarat (in Turkey) oah Shem Japheth Ham hina Asia Arphaxad Shalah4 Eber Peleg Fohi or Ya Noah) Gomer Tiras Cuh Phut DIndni Magog Tubal Espt Nimrod Serug 2 Nahor Terah 1 Assyria Biblical Records Non-Biblical Souroes Shin-NoNahor Abramiis Whang Ii This simplified version of family tree only takes spear side into account. In this HW, there will be only four persons: Noah and his three sons. Input file, named noah_family.txt, has two columns: (1) (Abraham) Lot 1. Goal: 1. Learn how to use constructor to load data for the private data members, such as array or vector, of the class. These data are loaded into the objects by using "new" operators and the objects are linked by the array (or vector) pointers 2. Learn how to use destructor to release dynamically allocated memory Requirement: Use class, struct and vector to implement a family tree which is top part of the one below The Genealogy of Noah came to rest on Mt Arrarat (in Turkey) oah Shem Japheth Ham hina Asia Arphaxad Shalah4 Eber Peleg Fohi or Ya Noah) Gomer Tiras Cuh Phut DIndni Magog Tubal Espt Nimrod Serug 2 Nahor Terah 1 Assyria Biblical Records Non-Biblical Souroes Shin-NoNahor Abramiis Whang Ii This simplified version of family tree only takes spear side into account. In this HW, there will be only four persons: Noah and his three sons. Input file, named noah_family.txt, has two columns: (1) (Abraham) Lot 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!