Skip to content

Instantly share code, notes, and snippets.

@BraynStorm
Created June 16, 2015 10:33
Show Gist options
  • Save BraynStorm/5d5a9a719406bef12a22 to your computer and use it in GitHub Desktop.
Save BraynStorm/5d5a9a719406bef12a22 to your computer and use it in GitHub Desktop.
Bojidar Stoqnov - PT4 Zadacha 2
#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