Created
June 16, 2015 10:33
-
-
Save BraynStorm/5d5a9a719406bef12a22 to your computer and use it in GitHub Desktop.
Bojidar Stoqnov - PT4 Zadacha 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Rect{ | |
public: | |
double a,b; | |
Rect(){ | |
a = 0; | |
b = 0; | |
cout << "Vuvedi A,B: "; | |
cin >> a >> b; | |
} | |
Rect(double A, double B){ | |
a = A; | |
b = B; | |
} | |
double getArea(){ | |
return a * b; | |
} | |
~Rect(){} | |
}; | |
int main(){ | |
Rect r1(10,20); | |
Rect r2 = Rect(); | |
cout << "r1 - S: " << r1.getArea() << endl; | |
cout << "r2 - S: " << r2.getArea(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment