Write code of C++ to create ‘Shape’ class and include following: Create these private data members in Shape class: width (float), length (float), name (string) Create wrappers (getters/setters) for each data member Create a constructor that initialises data members and a destructor that outputs data members Create a copy constructor in the class and use it in main function Include meaningful composition in the Shape class and use it in main function

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 6E
icon
Related questions
Question

 Write code of C++ to create ‘Shape’ class and include following:

  1. Create these private data members in Shape class: width (float), length (float), name (string)
  2. Create wrappers (getters/setters) for each data member
  3. Create a constructor that initialises data members and a destructor that outputs data members
  4. Create a copy constructor in the class and use it in main function
  5. Include meaningful composition in the Shape class and use it in main function
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ADT and 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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr