Starting Out With C++: Early Objects (10th Edition)
Starting Out With C++: Early Objects (10th Edition)
10th Edition
ISBN: 9780135235003
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 14, Problem 12PC
Program Plan Intro

Ancestral Trees

Program Plan:

  • Include required header files.
  • Declare and initialize string arrays “people []”, “mother []”, and “father []”.
  • Declare and initialize positions for the integer arrays “mom []”, and “pop []”.
  • Give function prototype “ancestors ()”.
  • Given function definition for “ancestors ()”.
    • Print the name of the person.
    • Check if mom’s position is not equal to -1.
      • Call the function ““ancestors ()”.
    • Check if pop’s position is not equal to -1.
      • Call the function ““ancestors ()”.
  • Define the function “main ()”. Inside this function,
    • Print the ancestors of the person containing index “0” from “people []” array by calling the function “ancestors ()” by passing “0” as the argument.
    • Print the ancestors of the person containing index “6” from “people []” array by calling the function “ancestors ()” by passing “6” as the argument.
    • Return the statement.

Blurred answer
Students have asked these similar questions
Subject-Object oriented programing Write a program which:• creates a new Array List• adds 5 decimal numbers to it• prints the list to the screenb) In the same program, insert an element in the above ArrayList at index 2. The resulting Array Listmust be one element larger. Print the resulting list to the screen.c) In the same program, replace the element in the ArrayList at index 2 by null. Print the resulting list tothe screen.d) In the same program, remove the element at the last index of the Array List. Print the resulting list tothe screen.e) In the same program, use a 'for' loop to print each element of the Array List to the screen.f) Create a class named ArrayListManager. Into this class, code a method which prints to the screenevery element of an Array List of strings placed at an odd index. Hint: use a modulus.
C++ Binary Search Tree program Create a class "Person" with three member variables string first name, string last name, int age. The primary key will be the last name. User will be prompted with a menu with two options: 1, "Enter person", where they will enter the persons first name, last name and age, or 2, "View person list" where the person may view the information previously added.
Course: Data Structure and Algorithims Language: Java Kindly make the program in 2 hours. Task is well explained.  You have to make the proogram properly in Java: Restriction: Prototype cannot be change you have to make program by using given prototype. TAsk: Create a class Node having two data members int data;     Node next;   Write the parametrized constructor of the class Node which contain one parameter int value assign this value to data and assign next to null Create class LinkList having one data members of type Node. Node head Write the following function in the LinkList class publicvoidinsertAtLast(int data);//this function add node at the end of the list publicvoid insertAthead(int data);//this function add node at the head of the list publicvoid deleteNode(int key);//this function find a node containing "key" and delete it publicvoid printLinkList();//this function print all the values in the Linklist public LinkListmergeList(LinkList l1,LinkList l2);// this function…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage