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

C++ programming Using the attached header file , create the companion . cpp file

ID: 3807176 • Letter: C

Question

C++ programming

Using the attached header file, create the companion .cpp file

#pragma once
#ifndef CRAYONBOX_H
#define CRAYONBOX_H
#include
using namespace std;

class CrayonBox {
private:
   string brand;
   int numInBox;
   static int numBoxes;
   string * colors; // pointer to dynamically allocated array of size numInBox
   void setColors(string *, int); // sets up array of colors
public:
   CrayonBox(string, int, string *);
   ~CrayonBox();
   static int getNumBoxes() { return numBoxes; }
   int getNumInBox() { return numInBox; }
   string getBrand() { return brand; }
   void setNumInBox(int);
   void printBox(); // print brand, numInBox, and colors
  
};
#endif

Explanation / Answer

#pragma once
#ifndef CRAYONBOX_H
#define CRAYONBOX_H
#include
using namespace std;

class CrayonBox {
private:
   string brand;
   int numInBox;
   static int numBoxes;
   string * colors; // pointer to dynamically allocated array of size numInBox
   void setColors(string *, int); // sets up array of colors
public:
   CrayonBox(string, int, string *);
   ~CrayonBox();
   static int getNumBoxes() { return numBoxes; }
   int getNumInBox() { return numInBox; }
   string getBrand() { return brand; }
   void setNumInBox(int);
   void printBox(); // print brand, numInBox, and colors
  
};
#endif

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote