Question
Write a C++ class, MyClass, that has tree member variable of type int, long, and float, respectively and one of them should use dynamically memory
Write a C++ class, MyClass, that has tree member variable of type int, long, and float, respectively and one of them should use dynamically memory allocation as learned in the class.
-
Your class must include three different type of constructor functions learned in the class.
-
Your class should include functions for setting the value of each type, getting the value of each type, and computing and returning the sum of each possible combination of types.
-
Implement overloaded assignment operator as one of class member functions.
-
Your class must include destructor function which takes care of dynamically
allocated members reside in heap space.
-
Test every feature (copy constructor, overloaded assignment operator, etc.) to
verify correctness of your code.
Use your favorite C++ compiler and run with sample inputs to generate proper output. Get a screenshot of your output and attach it to your source code to prove your code was compiled and ran successfully. Your source code should include proper comments.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started