From 50cc7d284f8d71d240baf9c2807d53ad65757a33 Mon Sep 17 00:00:00 2001 From: Sameer <142401625+sameer6pre@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:02:07 +0530 Subject: [PATCH] Update Lab_18/main.cpp in branch Precogs-fix-bb3o0j31 --- Lab_18/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Lab_18/main.cpp b/Lab_18/main.cpp index 336390f..1cd6b32 100644 --- a/Lab_18/main.cpp +++ b/Lab_18/main.cpp @@ -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