The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled C++ Code
Posted by: class pravougulnik | April 15, 2010 @ 7:32am
C++ Code
[
Download
]
//da se realizira klas pravougulnik chrez //double a - duljina //double b - shirina //G4 + funkcii i mutatori //2. klas kvadrat koito naslediava klas pravougulnik #include <iostream> using namespace std; class Rect { private: double a; double b; public: Rect(){ a=0; b=0; } Rect (double _a, double _b){ if (_a<0 || _b<0){ Rect(); cerr<<"ERROR"; } a=_a; b=_b; } double getA() const{ return a; } double getB() const{ return b; } double rectArea(Rect r){ return ((r.getA) * (r.getB)); } }; class Square: public Rect { };
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.29 / 8
52 Votes