Lab 8  Version 8
This is an array of shapes
 All Classes Functions
Public Member Functions | List of all members
Shape Class Reference

#include <Shape.h>

Public Member Functions

 Shape ()
 
void setNumberOfSides (int newNumberOfSides)
 
void setColor (string newColor)
 
int getNumberOfSides () const
 
string getColor () const
 

Detailed Description

This is a simple class that represents a shape that has two attributes, color and number of sides.

Constructor & Destructor Documentation

Shape::Shape ( )

This is the constructor. It should set the number of sides to 3 and the color to blue.

Member Function Documentation

string Shape::getColor ( ) const

This method will return the current color of the shape.

Returns
the color of the shape
int Shape::getNumberOfSides ( ) const

This method will return the current number of sides.

Returns
this will return the number of sides for this shape
void Shape::setColor ( string  newColor)

This is a method that will update the color of the shape. There are no restrictions on this parameter.

Parameters
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.

Parameters
newNumberOfSides- this must be at least 3

The documentation for this class was generated from the following files: