Question: QUESTION 1 100 points Save Answer (Please use the template shown in green text in your answer) Given the following class class GiftBox I Char*

 QUESTION 1 100 points Save Answer (Please use the template shown

QUESTION 1 100 points Save Answer (Please use the template shown in green text in your answer) Given the following class class GiftBox I Char* labelName; double cubeVolume; double weight; ; Answer the following questions: 1. Create default no-argument constructor to set the cubeVolume and weight to -1's, and the labelName to empty string (start with null character '\\0') 2. Create three arguments constructor to set the cubeVolume and weight, and labelName to the given argument values. Validate first if the double values are positive and the label name is not nullptr and not empty string '\\0' before using it, otherwise do nothing.) 3. Dene a destructor to deallocate the memory pointed by the labelName, and prints object type Gifton just destroyed 4. Implement a function called display that takes ostream (std::ostream& display()const;) to display the information as shown in the sample output. 5. Implement two member operators += double (adds the double value to the weight) and += object of same type (add the cubeSize and weight to the current one; no change for the label) (see sample outputs) 5. Implement a helper operator

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!