Professional Documents
Culture Documents
Week 1.pdf Aw
Week 1.pdf Aw
Week 1.pdf Aw
KARBALA UNIVERSITY
COLLEGE OF CS&IT
IT DEPARTMENT
STUDENT:YOUSF MOHAMMED
TO: DR. Meeras.s
Subject:OOP
using namespace std;
class GeometricShape {
public:
string shapeName;
void setShapeName(string shapename1) {
shapeName=shapename1; } };
hypotenuse=hypotenuse1; }
}
double getbase(){
return base;}
int main() {
Trigon obj(1,2,3);
obj.setShapeName("triangle");
Trigon obj1;
obj1.setShapeName("triangle");
Trigon obj2;obj2.setbase(1);
obj2.sethypotenuse(2);obj2.setperpendicular(3);
obj2.setShapeName("triangle");
cout<<"First area:"<<obj.displayArea()<<endl;
cout<<"Second area:"<<obj1.displayArea()<<endl;
cout<<"Third area:"<<obj2.displayArea()<<endl;
return 0;