Computers and Technology
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
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, riah133
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, meijorjay94p2u2zy
Apart from confidential information, what other information does nda to outline? ndas not only outline confidential information, but they also enable you to outline .
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, Auttyrain3929
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
image
Computers and Technology, 24.06.2019 07:00, Dkhaurithompson
Selective is defined as paying attention to messages that are consistent with one’s attitudes and beliefs and ignoring messages that are inconsistent.
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
Chemistry, 31.12.2019 02:31