C++ Write the DECLARATION of a class pet as follows: (HINT: you must INCLUDE this in another file) Data member variables: species, weight, age Functions: default constructor, constructor with parameters to set all variables, print, set species, set age, set weight. Be sure to include any necessary include and using directives. 2. Write the DEFINITION/IMPLEMENTATION (write the code) of the class pet declaration in Question 1. Write the code to implement (write the code for) the functions in the class pet. Be sure to include all using, includes and other directives necessary to complete the code. 3. Extend the pet class to include the following data members and functions i.e., INHERITANCE. DEFINE AND IMPLEMENT (write the code for) the extended class. Class will represent a pet of type Canine. Member variable name (i.e., pet name), color. Include member function includes, prototypes (declaration) and code (definition): all constructor(s), set color, set name and print to extend the base class pet. Create an object of the inherited class that sets all member variables to values of your choice, i.e., use the extended class as you would in a test/client program. You do not need to write any other code in the test/client. 4. Consider the pet and extended pet classes written in the previous questions: Write the PROTOTYPE for a function that overloads the + (plus) operator to add a value (i.e., 1) to the age data member in the extended/inherited pet object. Write as a member function. Write the PROTOTYPE for a function that overloads the << (insertion) operator to print an object of the extended/inherited pet object. Write the code to create one extended/inherited pet object. Write the line of code to add 1 to the age using the overloaded + (plus) operator. Write the line of code to print the extended/inherited pet object using the overloaded << (insertion) operator. You do not need to write any code for the functions, just the prototypes. You do need to create and objects of of the inherited pet class and write the code for c and d to represent using the prototypes created in a and b. You do not need to write any #include objects, main or function calls. Do not worry about setting any values for the data members. Assume any base get functions exist, if needed

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

C++

  1. Write the DECLARATION of a class pet as follows: (HINT: you must INCLUDE this in another file)

Data member variables: species, weight, age

    1. Functions: default constructor, constructor with parameters to set all variables, print, set species, set age, set weight.
    2. Be sure to include any necessary include and using directives.

2. Write the DEFINITION/IMPLEMENTATION (write the code) of the class pet declaration in Question 1.

  1. Write the code to implement (write the code for) the functions in the class pet.
  2. Be sure to include all using, includes and other directives necessary to complete the code.

3. Extend the pet class to include the following data members and functions i.e., INHERITANCE. DEFINE AND IMPLEMENT (write the code for) the extended class. Class will represent a pet of type Canine.

  1. Member variable name (i.e., pet name), color.
  2. Include member function includes, prototypes (declaration) and code (definition): all constructor(s), set color, set name and print to extend the base class pet.
  3. Create an object of the inherited class that sets all member variables to values of your choice, i.e., use the extended class as you would in a test/client program. You do not need to write any other code in the test/client.

4. Consider the pet and extended pet classes written in the previous questions:

  1. Write the PROTOTYPE for a function that overloads the + (plus) operator to add a value (i.e., 1) to the age data member in the extended/inherited pet object. Write as a member function.
  2. Write the PROTOTYPE for a function that overloads the << (insertion) operator to print an object of the extended/inherited pet object.
  3. Write the code to create one extended/inherited pet object. Write the line of code to add 1 to the age using the overloaded + (plus) operator.
  4. Write the line of code to print the extended/inherited pet object using the overloaded << (insertion) operator.

You do not need to write any code for the functions, just the prototypes.

You do need to create and objects of of the inherited pet class and write the code for c and d to represent using the prototypes created in a and b.

You do not need to write any #include objects, main or function calls. Do not worry about setting any values for the data members. Assume any base get functions exist, if needed

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education