Class named Basket that holds information about a fruit basket…. Class named Basket that holds information about a fruit basket. Place your class definition in a header file named Basket.h and your function definitions in an implementation file named Basket.cpp.Include in your solution all of the statements necessary for your code to compile under a standard C++ compiler and within the sdds namespace.Add to this module a custom type called Fruit:struct Fruit { char m_name[30 + 1]; // the name of the fruit double m_qty; // quantity in kilograms }; Thank you in advance !!! Basket ClassDesign and code a class named Basket that holds information about a fruit basket.Basket Private MembersThe class should be able to store the following data:m_fruits: a dynamically allocated array of objects of type Fruit. This is the resource that you must manage.m_cnt: the size of the m_fruits array.m_price: the price of the basket.You can add any other private members in the class, as required by your design.Basket Public Membersthe default constructora custom constructor that receives as parameters an array of objects of type Fruit, the size of the array received in the fist parameter, and the price of the basket (in this order); stores the parameters into the attributes if all the parameters are valid (the numbers are greater than 0, and the array is not null).the copy constructor (deep-copy for the resource, and a shallow copy for the other attributes)the copy assignment operator (deep-copy for the resource, and a shallow copy for the other attributes; note that the copy constructor and copy assignment operator have almost identical logic — reuse the code)the destructorvoid setPrice(double price): updates the m_price attribute to the value received as parameterthe conversion to bool operator: returns true if the basket contains any fruits, false otherwise.an overload of the += operator that receives as a parameter an object of type Fruit (by value) and adds it to the attribute m_fruits (resize the array-attribute; check previous workshops if you need a refresh on resizing a dynamic array)Friend Helper Functionsoverload the insertion operator (operator<<) to insert into the stream (received as the first parameter) the content of an object of type Basket (received as the second parameter).If the basket doesn't contain any fruit, print the message The basket is empty!
You will get a plagiarism-free paper and you can get an originality report upon request.
All the personal information is confidential and we have 100% safe payment methods. We also guarantee good grades
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more