Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Lab_18/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@ class Triangle : public Shape
// Rectangle class to calculate the area of rectangle
class Rectanglee : public Shape
{
private:
double base = 0.0; // FIX: Initialize base
double height = 0.0; // FIX: Initialize height

public:
void display_area()
{
cout << "Area of Rectangle: " << base * height << endl;
}
void display_area()
{
cout << "Area of Rectangle: " << base * height << endl;
}
};

class Circle : public Shape
Expand Down