SlideShare a Scribd company logo
1 of 2
C++
5.6.2 Basic derived class member override
Define a member function PrintAll() for class PetData that prints output as follows with inputs
"Fluffy, 5, andd 4444. Hint: Make use of the base class' PrintAll() function.
Name: Fluffy, Age: 5, ID: 4444
#include <iostream>
#include <string>
using namespace std;
class AnimalData {
public:
void SetName(string givenName) {
fullName = givenName;
};
void SetAge(int numYears) {
ageYears = numYears;
};
//Other parts omitted
void PrintAll() {
cout << "Name: " << fullName;
cout << "Age: " << ageYears;
};
class PetData: public AnimalData {
public:
void SetID(int petID) {
idNum = petID;
};
// FIXME: Add PrintAll() member function
void PrintAll() {
cout << "Name: " << fullName;
cout << ", Age: " << ageYears;
}
void PrintAll() {
AnimalData::PrintAll();
cout << ", ID: " << idNum << endl;
};
private:
int idNum;
};
I am confused with the printAll() section and it is printing errors

More Related Content

Similar to C++ 5-6-2 Basic derived class member override Define a member function.docx

Railway reservation
Railway reservationRailway reservation
Railway reservationSwarup Boro
 
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdfC++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdffathimafancy
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfAroraRajinder1
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116Paulo Morgado
 
Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiMuhammed Thanveer M
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docxrafbolet0
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specificationsrajkumari873
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operatorsHarleen Sodhi
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdfaplolomedicalstoremr
 
R. herves. clean code (theme)2
R. herves. clean code (theme)2R. herves. clean code (theme)2
R. herves. clean code (theme)2saber tabatabaee
 
I am trying to change this code from STRUCTS to CLASSES, the members.pdf
I am trying to change this code from STRUCTS to CLASSES, the members.pdfI am trying to change this code from STRUCTS to CLASSES, the members.pdf
I am trying to change this code from STRUCTS to CLASSES, the members.pdfpetercoiffeur18
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdfmhande899
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIjagriti srivastava
 

Similar to C++ 5-6-2 Basic derived class member override Define a member function.docx (20)

Railway reservation
Railway reservationRailway reservation
Railway reservation
 
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdfC++ ProgrammingSo I received help with a code that takes a diabet.pdf
C++ ProgrammingSo I received help with a code that takes a diabet.pdf
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
C++ L09-Classes Part2
C++ L09-Classes Part2C++ L09-Classes Part2
C++ L09-Classes Part2
 
What's new in C# 6 - NetPonto Porto 20160116
What's new in C# 6  - NetPonto Porto 20160116What's new in C# 6  - NetPonto Porto 20160116
What's new in C# 6 - NetPonto Porto 20160116
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Oop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer MelayiOop concept in c++ by MUhammed Thanveer Melayi
Oop concept in c++ by MUhammed Thanveer Melayi
 
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
Quest 1 define a class batsman with the following specifications
Quest  1 define a class batsman with the following specificationsQuest  1 define a class batsman with the following specifications
Quest 1 define a class batsman with the following specifications
 
Wap to implement bitwise operators
Wap to implement bitwise operatorsWap to implement bitwise operators
Wap to implement bitwise operators
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
 
R. herves. clean code (theme)2
R. herves. clean code (theme)2R. herves. clean code (theme)2
R. herves. clean code (theme)2
 
I am trying to change this code from STRUCTS to CLASSES, the members.pdf
I am trying to change this code from STRUCTS to CLASSES, the members.pdfI am trying to change this code from STRUCTS to CLASSES, the members.pdf
I am trying to change this code from STRUCTS to CLASSES, the members.pdf
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
C language concept with code apna college.pdf
C language concept with code apna college.pdfC language concept with code apna college.pdf
C language concept with code apna college.pdf
 
PHP7 Presentation
PHP7 PresentationPHP7 Presentation
PHP7 Presentation
 
Basic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time APIBasic java, java collection Framework and Date Time API
Basic java, java collection Framework and Date Time API
 
Bubble and selection
Bubble and selectionBubble and selection
Bubble and selection
 

More from RichardjOZTerryp

c- Explain several methods for how zoonotic disease-causing microbes c.docx
c- Explain several methods for how zoonotic disease-causing microbes c.docxc- Explain several methods for how zoonotic disease-causing microbes c.docx
c- Explain several methods for how zoonotic disease-causing microbes c.docxRichardjOZTerryp
 
C++ Linux Need help with lab assignment- Instructions and code is post.docx
C++ Linux Need help with lab assignment- Instructions and code is post.docxC++ Linux Need help with lab assignment- Instructions and code is post.docx
C++ Linux Need help with lab assignment- Instructions and code is post.docxRichardjOZTerryp
 
By now everyone has heard news reports about balloons in the sky- Were.docx
By now everyone has heard news reports about balloons in the sky- Were.docxBy now everyone has heard news reports about balloons in the sky- Were.docx
By now everyone has heard news reports about balloons in the sky- Were.docxRichardjOZTerryp
 
Businesses that are overleveraged carry a large amount of debt and are.docx
Businesses that are overleveraged carry a large amount of debt and are.docxBusinesses that are overleveraged carry a large amount of debt and are.docx
Businesses that are overleveraged carry a large amount of debt and are.docxRichardjOZTerryp
 
Business requirements refine the Logical design phase from a functiona.docx
Business requirements refine the Logical design phase from a functiona.docxBusiness requirements refine the Logical design phase from a functiona.docx
Business requirements refine the Logical design phase from a functiona.docxRichardjOZTerryp
 
Briefly explain the following as applied to database design- What is D.docx
Briefly explain the following as applied to database design- What is D.docxBriefly explain the following as applied to database design- What is D.docx
Briefly explain the following as applied to database design- What is D.docxRichardjOZTerryp
 
bottles of wine every day- The daily production in Italy is either 200.docx
bottles of wine every day- The daily production in Italy is either 200.docxbottles of wine every day- The daily production in Italy is either 200.docx
bottles of wine every day- The daily production in Italy is either 200.docxRichardjOZTerryp
 
Bones Structure and Function Lab Identify the following structures in.docx
Bones Structure and Function Lab Identify the following structures in.docxBones Structure and Function Lab Identify the following structures in.docx
Bones Structure and Function Lab Identify the following structures in.docxRichardjOZTerryp
 
Bone and Structure Lab1-) Identify types of bones based upon their sha.docx
Bone and Structure Lab1-) Identify types of bones based upon their sha.docxBone and Structure Lab1-) Identify types of bones based upon their sha.docx
Bone and Structure Lab1-) Identify types of bones based upon their sha.docxRichardjOZTerryp
 
bond issue-What will be the total interest payments over the five-year.docx
bond issue-What will be the total interest payments over the five-year.docxbond issue-What will be the total interest payments over the five-year.docx
bond issue-What will be the total interest payments over the five-year.docxRichardjOZTerryp
 
Below is the Tycho crater on the surface of the Moon- The left image p.docx
Below is the Tycho crater on the surface of the Moon- The left image p.docxBelow is the Tycho crater on the surface of the Moon- The left image p.docx
Below is the Tycho crater on the surface of the Moon- The left image p.docxRichardjOZTerryp
 
Below b a graph showing alinear regression of Ser genotypes and dorsa.docx
Below b a graph showing alinear regression of  Ser genotypes and dorsa.docxBelow b a graph showing alinear regression of  Ser genotypes and dorsa.docx
Below b a graph showing alinear regression of Ser genotypes and dorsa.docxRichardjOZTerryp
 
Below is an impact crater on the surface of the Earth- This is the Met.docx
Below is an impact crater on the surface of the Earth- This is the Met.docxBelow is an impact crater on the surface of the Earth- This is the Met.docx
Below is an impact crater on the surface of the Earth- This is the Met.docxRichardjOZTerryp
 
Being a taker can be potentially beneficial because- Select one- A- th.docx
Being a taker can be potentially beneficial because- Select one- A- th.docxBeing a taker can be potentially beneficial because- Select one- A- th.docx
Being a taker can be potentially beneficial because- Select one- A- th.docxRichardjOZTerryp
 
below is some of the work i began on LispEvaluate on java- but i'm hav.docx
below is some of the work i began on LispEvaluate on java- but i'm hav.docxbelow is some of the work i began on LispEvaluate on java- but i'm hav.docx
below is some of the work i began on LispEvaluate on java- but i'm hav.docxRichardjOZTerryp
 
Below is an idealized diagram of several oceanic plates and a continen.docx
Below is an idealized diagram of several oceanic plates and a continen.docxBelow is an idealized diagram of several oceanic plates and a continen.docx
Below is an idealized diagram of several oceanic plates and a continen.docxRichardjOZTerryp
 
Begin on the left side of the map and trace over 30oN latitude with yo.docx
Begin on the left side of the map and trace over 30oN latitude with yo.docxBegin on the left side of the map and trace over 30oN latitude with yo.docx
Begin on the left side of the map and trace over 30oN latitude with yo.docxRichardjOZTerryp
 
Before June production is recorded- the Work in Process inventory acco.docx
Before June production is recorded- the Work in Process inventory acco.docxBefore June production is recorded- the Work in Process inventory acco.docx
Before June production is recorded- the Work in Process inventory acco.docxRichardjOZTerryp
 
Because human wants are insatiable and unlimited while available resou.docx
Because human wants are insatiable and unlimited while available resou.docxBecause human wants are insatiable and unlimited while available resou.docx
Because human wants are insatiable and unlimited while available resou.docxRichardjOZTerryp
 
Cash budgets are based on cash accounting rather than accrual accounti.docx
Cash budgets are based on cash accounting rather than accrual accounti.docxCash budgets are based on cash accounting rather than accrual accounti.docx
Cash budgets are based on cash accounting rather than accrual accounti.docxRichardjOZTerryp
 

More from RichardjOZTerryp (20)

c- Explain several methods for how zoonotic disease-causing microbes c.docx
c- Explain several methods for how zoonotic disease-causing microbes c.docxc- Explain several methods for how zoonotic disease-causing microbes c.docx
c- Explain several methods for how zoonotic disease-causing microbes c.docx
 
C++ Linux Need help with lab assignment- Instructions and code is post.docx
C++ Linux Need help with lab assignment- Instructions and code is post.docxC++ Linux Need help with lab assignment- Instructions and code is post.docx
C++ Linux Need help with lab assignment- Instructions and code is post.docx
 
By now everyone has heard news reports about balloons in the sky- Were.docx
By now everyone has heard news reports about balloons in the sky- Were.docxBy now everyone has heard news reports about balloons in the sky- Were.docx
By now everyone has heard news reports about balloons in the sky- Were.docx
 
Businesses that are overleveraged carry a large amount of debt and are.docx
Businesses that are overleveraged carry a large amount of debt and are.docxBusinesses that are overleveraged carry a large amount of debt and are.docx
Businesses that are overleveraged carry a large amount of debt and are.docx
 
Business requirements refine the Logical design phase from a functiona.docx
Business requirements refine the Logical design phase from a functiona.docxBusiness requirements refine the Logical design phase from a functiona.docx
Business requirements refine the Logical design phase from a functiona.docx
 
Briefly explain the following as applied to database design- What is D.docx
Briefly explain the following as applied to database design- What is D.docxBriefly explain the following as applied to database design- What is D.docx
Briefly explain the following as applied to database design- What is D.docx
 
bottles of wine every day- The daily production in Italy is either 200.docx
bottles of wine every day- The daily production in Italy is either 200.docxbottles of wine every day- The daily production in Italy is either 200.docx
bottles of wine every day- The daily production in Italy is either 200.docx
 
Bones Structure and Function Lab Identify the following structures in.docx
Bones Structure and Function Lab Identify the following structures in.docxBones Structure and Function Lab Identify the following structures in.docx
Bones Structure and Function Lab Identify the following structures in.docx
 
Bone and Structure Lab1-) Identify types of bones based upon their sha.docx
Bone and Structure Lab1-) Identify types of bones based upon their sha.docxBone and Structure Lab1-) Identify types of bones based upon their sha.docx
Bone and Structure Lab1-) Identify types of bones based upon their sha.docx
 
bond issue-What will be the total interest payments over the five-year.docx
bond issue-What will be the total interest payments over the five-year.docxbond issue-What will be the total interest payments over the five-year.docx
bond issue-What will be the total interest payments over the five-year.docx
 
Below is the Tycho crater on the surface of the Moon- The left image p.docx
Below is the Tycho crater on the surface of the Moon- The left image p.docxBelow is the Tycho crater on the surface of the Moon- The left image p.docx
Below is the Tycho crater on the surface of the Moon- The left image p.docx
 
Below b a graph showing alinear regression of Ser genotypes and dorsa.docx
Below b a graph showing alinear regression of  Ser genotypes and dorsa.docxBelow b a graph showing alinear regression of  Ser genotypes and dorsa.docx
Below b a graph showing alinear regression of Ser genotypes and dorsa.docx
 
Below is an impact crater on the surface of the Earth- This is the Met.docx
Below is an impact crater on the surface of the Earth- This is the Met.docxBelow is an impact crater on the surface of the Earth- This is the Met.docx
Below is an impact crater on the surface of the Earth- This is the Met.docx
 
Being a taker can be potentially beneficial because- Select one- A- th.docx
Being a taker can be potentially beneficial because- Select one- A- th.docxBeing a taker can be potentially beneficial because- Select one- A- th.docx
Being a taker can be potentially beneficial because- Select one- A- th.docx
 
below is some of the work i began on LispEvaluate on java- but i'm hav.docx
below is some of the work i began on LispEvaluate on java- but i'm hav.docxbelow is some of the work i began on LispEvaluate on java- but i'm hav.docx
below is some of the work i began on LispEvaluate on java- but i'm hav.docx
 
Below is an idealized diagram of several oceanic plates and a continen.docx
Below is an idealized diagram of several oceanic plates and a continen.docxBelow is an idealized diagram of several oceanic plates and a continen.docx
Below is an idealized diagram of several oceanic plates and a continen.docx
 
Begin on the left side of the map and trace over 30oN latitude with yo.docx
Begin on the left side of the map and trace over 30oN latitude with yo.docxBegin on the left side of the map and trace over 30oN latitude with yo.docx
Begin on the left side of the map and trace over 30oN latitude with yo.docx
 
Before June production is recorded- the Work in Process inventory acco.docx
Before June production is recorded- the Work in Process inventory acco.docxBefore June production is recorded- the Work in Process inventory acco.docx
Before June production is recorded- the Work in Process inventory acco.docx
 
Because human wants are insatiable and unlimited while available resou.docx
Because human wants are insatiable and unlimited while available resou.docxBecause human wants are insatiable and unlimited while available resou.docx
Because human wants are insatiable and unlimited while available resou.docx
 
Cash budgets are based on cash accounting rather than accrual accounti.docx
Cash budgets are based on cash accounting rather than accrual accounti.docxCash budgets are based on cash accounting rather than accrual accounti.docx
Cash budgets are based on cash accounting rather than accrual accounti.docx
 

Recently uploaded

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Recently uploaded (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

C++ 5-6-2 Basic derived class member override Define a member function.docx

  • 1. C++ 5.6.2 Basic derived class member override Define a member function PrintAll() for class PetData that prints output as follows with inputs "Fluffy, 5, andd 4444. Hint: Make use of the base class' PrintAll() function. Name: Fluffy, Age: 5, ID: 4444 #include <iostream> #include <string> using namespace std; class AnimalData { public: void SetName(string givenName) { fullName = givenName; }; void SetAge(int numYears) { ageYears = numYears; }; //Other parts omitted void PrintAll() { cout << "Name: " << fullName; cout << "Age: " << ageYears; }; class PetData: public AnimalData { public: void SetID(int petID) {
  • 2. idNum = petID; }; // FIXME: Add PrintAll() member function void PrintAll() { cout << "Name: " << fullName; cout << ", Age: " << ageYears; } void PrintAll() { AnimalData::PrintAll(); cout << ", ID: " << idNum << endl; }; private: int idNum; }; I am confused with the printAll() section and it is printing errors