Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Shape.h@0:3f07a74c8248, 2019-02-14 (annotated)
- Committer:
- kaushalpkk
- Date:
- Thu Feb 14 12:04:39 2019 +0000
- Revision:
- 0:3f07a74c8248
...
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kaushalpkk | 0:3f07a74c8248 | 1 | |
| kaushalpkk | 0:3f07a74c8248 | 2 | /* |
| kaushalpkk | 0:3f07a74c8248 | 3 | the header file consists of the declaration of the shape class and |
| kaushalpkk | 0:3f07a74c8248 | 4 | declaration of function and variables in the class |
| kaushalpkk | 0:3f07a74c8248 | 5 | |
| kaushalpkk | 0:3f07a74c8248 | 6 | */ |
| kaushalpkk | 0:3f07a74c8248 | 7 | |
| kaushalpkk | 0:3f07a74c8248 | 8 | |
| kaushalpkk | 0:3f07a74c8248 | 9 | class Shape{ //class declaration |
| kaushalpkk | 0:3f07a74c8248 | 10 | public: // the content underneath the public are accessible outside the class |
| kaushalpkk | 0:3f07a74c8248 | 11 | //constructors |
| kaushalpkk | 0:3f07a74c8248 | 12 | Shape(int); |
| kaushalpkk | 0:3f07a74c8248 | 13 | Shape(int, int); |
| kaushalpkk | 0:3f07a74c8248 | 14 | |
| kaushalpkk | 0:3f07a74c8248 | 15 | //functions |
| kaushalpkk | 0:3f07a74c8248 | 16 | int getArea(); |
| kaushalpkk | 0:3f07a74c8248 | 17 | int getPerim(); |
| kaushalpkk | 0:3f07a74c8248 | 18 | void printInfo(); |
| kaushalpkk | 0:3f07a74c8248 | 19 | |
| kaushalpkk | 0:3f07a74c8248 | 20 | private: //the private variables are not accessible outside the class. |
| kaushalpkk | 0:3f07a74c8248 | 21 | int _a, _b; // a personal choice to have the variable names start with an '_' |
| kaushalpkk | 0:3f07a74c8248 | 22 | }; |