...
Shape Class Reference
A library to create square and rectangle objects. More...
#include <Shape.h>
Public Member Functions | |
Shape (int x) | |
create an object for square | |
Shape (int x, int y) | |
create an object for rectangle | |
int | getArea () |
returns to area of rectangle/square | |
int | getPerimeter () |
returns to perimeter of rectangle/square |
Detailed Description
A library to create square and rectangle objects.
calculates the area and perimeter
Example:
#include "mbed.h" #include "Shape.h" Shape rect(3,4); Shape squr(1); int main() { printf(" area of rect = %d \n", rect.getArea()); printf("perimeter of square = %d \n", squr.getPerimeter()); }
Definition at line 27 of file Shape.h.
Constructor & Destructor Documentation
Shape | ( | int | x ) |
Shape | ( | int | x, |
int | y | ||
) |
Member Function Documentation
int getArea | ( | ) |
Generated on Wed Jul 13 2022 07:28:13 by 1.7.2