Use One Coord Classes Make Coord Inherit Color Class Library Includes Include Needed O Inc Q37272238

Use one of the Coord Classes and make Coord inherit theColor class

******************************************
* library includes
******************************************/
#include <iostream> // needed for I/O
#include <iomanip>
#include <cmath>
/******************************************
* pre-processor
******************************************/
#define PI 3.14159
using namespace std;

class Color
{
private:
       int* red;
       int* green;
       int* blue;
public:
// constructors
Color();
Color(int);
//the int is assigned to all three color data items
Color(int r, int g, int b);
//the 3 ints are assigned to the corresponding data items
//r into red, g into green, b into blue

// destructor
~Color();

// setters
       void setRed(int r)  {*red = r;}
       void setGreen(int g)  {*green = g;}
       void setBlue(int b)  {*blue = b;}
  
// getters
       int getRed() const  {return *red;}
       int getGreen() const  {return *green;}
      

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.