Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please use C++ programming CrayonBox - brand : string Who makes the crayons - nu

ID: 3828593 • Letter: P

Question

please use C++ programming

CrayonBox

- brand : string Who makes the crayons

- numInBox : int How many crayons in the box

- colors : string * Dynamically allocated array of colors

- numBoxes : int Number of instances of CrayonBox  

+ CrayonBox(string, int, string*) Constructor takes Brand and # in box, string array of colors

+ ~CrayonBox()

+ getNumBoxes() Returns number of instances of CrayonBox

+ Getters and Setters Note: the signature to set colors is setColors(string*, int) : void

+ printBox() : void Function to print the brand, # in box and all the colors

Given the UML above, create the header file

Explanation / Answer

HI, Please find Header FIle for above UML Diagram.

// Header File

class CrayonBox{

private:
   string brand;
   int numInBox;
   string *colors;

   static int numBoxes;

public:
   CrayonBox(string, int, string*);
   ~CrayonBox();

   int getNumBoxes();
   string getBrand();
   int getNumIntBox();
   string *getColors();

   void setColors(string*, int);
   void setBrand(string );
   void setNumInBox(int n);

   void printBox();
};

Please let me know in case of any issue