subject
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
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:30
Which number on the image above correctly indicates the name of a folder in this url? a.1b.2c.3d.4
Answers: 2
question
Computers and Technology, 22.06.2019 12:00
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
The base class Pet has private data members petName, and petAge. The derived class Dog extends the P...
Questions
question
Social Studies, 29.07.2019 07:30
question
Mathematics, 29.07.2019 07:30
question
Social Studies, 29.07.2019 07:30
Questions on the website: 13722362