Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 (3 string data types)
Name
PetType (this would be something like Dog, Cat, Bird, etc.)
Sound
Constructors/Getters/Setters/Functions
Constructor -3 arguments - name, pet type, and sound
Getters/Setters for all three attributes
PrintPet method/function 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 3 Argument Constructor.
Output of the values of the attributes Pet instance as shown above. also include function prototype and use namespace.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Why advertising is important in promotion of a product ?

Answered: 1 week ago

Question

What is community?

Answered: 1 week ago

Question

What are the features of the community?

Answered: 1 week ago

Question

1. What are Associations ?

Answered: 1 week ago

Question

1. What is socialization?

Answered: 1 week ago