#include <Shape.h>
Public Member Functions | |
Shape () | |
void | setNumberOfSides (int newNumberOfSides) |
void | setColor (string newColor) |
int | getNumberOfSides () const |
string | getColor () const |
This is a simple class that represents a shape that has two attributes, color and number of sides.
Shape::Shape | ( | ) |
This is the constructor. It should set the number of sides to 3 and the color to blue.
string Shape::getColor | ( | ) | const |
This method will return the current color of the shape.
int Shape::getNumberOfSides | ( | ) | const |
This method will return the current number of sides.
void Shape::setColor | ( | string | newColor | ) |
This is a method that will update the color of the shape. There are no restrictions on this parameter.
newColor | - the new color for the shape |
void Shape::setNumberOfSides | ( | int | newNumberOfSides | ) |
This is a method that will allow you to update the number of sides. The number must be at least 3 otherwise the number of sides is not updated.
newNumberOfSides | - this must be at least 3 |