![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 06.12.2021 16:30, Crxymia
The base class Pet has private data members petName, and petAge. The derived class Dog extends the Pet class and includes a private data member for dogBreed. Complete main() to:
create a generic pet and print information using PrintInfo().
create a Dog pet, use PrintInfo() to print information, and add a statement to print the dog's breed using the GetBreed() function.
Ex. If the input is:
Dobby
2
Kreacher
3
German Schnauzer
the output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: German Schnauzer
the given code:
Main. cpp:
#include
#include
#include "Dog. h"
using namespace std;
int main() {
string petName, dogName, dogBreed;
int petAge, dogAge;
Pet myPet;
Dog myDog;
getline(cin, petName);
cin >> petAge;
cin. ignore();
getline(cin, dogName);
cin >> dogAge;
cin. ignore();
getline(cin, dogBreed);
// TODO: Create generic pet (using petName, petAge) and then call PrintInfo
// TODO: Create dog pet (using dogName, dogAge, dogBreed) and then call PrintInfo
// TODO: Use GetBreed(), to output the breed of the dog
}
![answer](/tpl/images/cats/otvet.png)
Answers: 3
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 10:50, whyidkmyself
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 17:20, Morehollie9428
What is the best assassins creed game?
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 03:30, live4dramaoy0yf9
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
Do you know the correct answer?
The base class Pet has private data members petName, and petAge. The derived class Dog extends the P...
Questions in other subjects:
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 01.09.2019 19:50
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 01.09.2019 19:50
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 01.09.2019 19:50
![Konu](/tpl/images/cats/istoriya.png)
History, 01.09.2019 19:50
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/health.png)
Health, 01.09.2019 19:50