Question: Write a C + + Class called Pet and include the following attributes ( 3 string data types ) Name PetType ( this would be
Write a C Class called Pet and include the following attributes string data types
Name
PetType this would be something like Dog, Cat, Bird, etc.
Sound
ConstructorsGettersSettersFunctions
Constructor arguments name, pet type, and sound
GettersSetters for all three attributes
PrintPet methodfunction that will print the attributes such as:
Name: Fluffy
Type: Cat
Sound: Meow
Program User prompts:
Name
PetType this would be something like Dog, Cat, Bird, etc.
Sound
Program requirements
Main program to demonstrate the class. Your main Method
Pet.h file or hpp depending on your IDE
Pet.cpp file
You will need to prompt the user for the Pet information to populate the Pet class attributes. Once you
have the data create a Pet and hand the variables to the Argument Constructor.
Output of the values of the attributes Pet instance as shown above. also include function prototype and use namespace.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
