n/a
Revision 0:f3642f9dd5f6, committed 2016-03-22
- Comitter:
- kch78
- Date:
- Tue Mar 22 09:30:09 2016 +0000
- Commit message:
- 1
Changed in this revision
Rectangle.cpp | Show annotated file Show diff for this revision Revisions of this file |
Rectangle.h | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Rectangle.cpp Tue Mar 22 09:30:09 2016 +0000 @@ -0,0 +1,15 @@ +#include "Rectangle.h" +#include "mbed.h" +#include "Shape.h" +#include <string> + +Rectangle::Rectangle(float width, float height) +{ + this->width = width; + this->height = height; +} + +float Rectangle::getArea() +{ + return width * height; +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Rectangle.h Tue Mar 22 09:30:09 2016 +0000 @@ -0,0 +1,14 @@ +#ifndef MBED_RECTANGLE_H +#define MBED_RECTANGLE_H +#include "mbed.h" +#include "Shape.h" +#include <string> + +class Rectangle : public Shape +{ + public: + Rectangle (float width, float height); + float getArea(); +}; + +#endif \ No newline at end of file