Write a C++ program that tells the eldest and youngest sibling in a family. Your code should include a class named as Sibling, having following private data members are name and age. Make array of objects by prompting the user, the number of siblings a family Then compare the ages of all the siblings and sort them in ascending or descending order and display the eldest and youngest sibling amongst the Write the Setter functions to set or assign values to all data members of a Class Sibling. Write the Getter functions to get value of all data members of a Class Sibling. Also write default and parameterized constructor for the class Sibling. Your output should be similar to the following: Please enter the number of siblings: 4   Please enter the particulars of each sibling: Please enter the particulars of Sibling: 1 Name:      Arif Age: 20   Please enter the particulars of Sibling: 2 Name:                Sana Age: 16   Please enter the particulars of Sibling: 3 Name:                Sobia Age: 13   Please enter the particulars of Sibling: 4 Name:                Amna Age: 10   Arif, having age 20 is the eldest sibling whereas Amna, having age 10 is the youngest.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Write a C++ program that tells the eldest and youngest sibling in a family. Your code should include a class named as Sibling, having following private data members are name and age.

  • Make array of objects by prompting the user, the number of siblings a family
  • Then compare the ages of all the siblings and sort them in ascending or descending order and display the eldest and youngest sibling amongst the
  • Write the Setter functions to set or assign values to all data members of a Class Sibling.
  • Write the Getter functions to get value of all data members of a Class Sibling.
  • Also write default and parameterized constructor for the class Sibling. Your output should be similar to the following:

Please enter the number of siblings: 4

 

Please enter the particulars of each sibling: Please enter the particulars of Sibling: 1 Name:      Arif

Age: 20

 

Please enter the particulars of Sibling: 2 Name:                Sana

Age: 16

 

Please enter the particulars of Sibling: 3 Name:                Sobia

Age: 13

 

Please enter the particulars of Sibling: 4 Name:                Amna

Age: 10

 

Arif, having age 20 is the eldest sibling whereas Amna, having age 10 is the youngest.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Reference Types in Function
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education