n/a
Square.cpp@0:202298a7e6bc, 2016-03-22 (annotated)
- Committer:
- kch78
- Date:
- Tue Mar 22 09:30:17 2016 +0000
- Revision:
- 0:202298a7e6bc
- Child:
- 1:f72e3e1af03d
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kch78 | 0:202298a7e6bc | 1 | #include "Square.h" |
kch78 | 0:202298a7e6bc | 2 | #include "Rectangle.h" |
kch78 | 0:202298a7e6bc | 3 | #include "mbed.h" |
kch78 | 0:202298a7e6bc | 4 | #include <string> |
kch78 | 0:202298a7e6bc | 5 | |
kch78 | 0:202298a7e6bc | 6 | Square::Square(float size) : Rectangle(size, size) |
kch78 | 0:202298a7e6bc | 7 | { |
kch78 | 0:202298a7e6bc | 8 | this->width = size; |
kch78 | 0:202298a7e6bc | 9 | this->height = size; |
kch78 | 0:202298a7e6bc | 10 | } |
kch78 | 0:202298a7e6bc | 11 | |
kch78 | 0:202298a7e6bc | 12 | float Square::getArea() |
kch78 | 0:202298a7e6bc | 13 | { |
kch78 | 0:202298a7e6bc | 14 | return width * height; |
kch78 | 0:202298a7e6bc | 15 | } |