Term Project C++ Pet Class
Problem Specification:
Design a class named Pet, which should have the followingfields:
• name: The name field holds the name of a pet.
• type: The type field holds the type of animal that a pet is.Example values are “Dogâ€, “Catâ€, and “Birdâ€.
• age: The age field holds the pet’s age. The Pet class shouldalso have the following methods:
• setName: The setName method stores a value in the namefield.
• setType: The setType method stores a value in the typefield.
• setAge: The setAge method stores a value in the age filed.
• getName: The getName method returns the value of the namefield.
• getType: The getType method returns the value of the typefield.
• getAge: The getAge method returns the value of the agefield.
Once you have designed the class, design a program that createsan object of the class and prompts the user to enter the name,type, and age of his or her pet.
This data should be stored in the object. Use the object’saccessor methods to retrieve the pet’s name, type, and age anddisplay this data on the screen.
Program Output (with Input Shown in Bold): Enter a petname: Lucky Enter a pet type: German Shepherd Enter a pet age: 2The pet name is Lucky The pet type is German Shepherd The pet ageis 2