Solved

Consider the Following Code Fragments

Question 40

Essay

Consider the following code fragments:
class PetStoreItem
{
protected:
int stockNum;
double price;
public:
PetStoreItem(int, double);
};
class PetStoreAnimal : public PetStoreItem
{
protected:
int petAge;
public:
PetStoreAnimal(int);
};
PetStoreAnimal::PetStoreAnimal(int age)
{
petAge = age;
}
Change the PetStoreAnimal constructor to avoid getting an error.

Correct Answer:

verifed

Verified

The provided constructor will not work b...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions