Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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*

image text in transcribed
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

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

1.what is rule of law? 2.The administrative body of government?

Answered: 1 week ago

Question

Write a short note on - JUDICIARY

Answered: 1 week ago