Get Mystery Box with random crypto!

Here, we have created a parameterized constructor Wall() that | C

Here, we have created a parameterized constructor Wall() that has 2 parameters: double len and double hgt. The values contained in these parameters are used to initialize the member variables length and height.

When we create an object of the Wall class, we pass the values for the member variables as arguments. The code for this is:

Wall wall1(10.5, 8.6);
Wall wall2(8.5, 6.3);

With the member variables thus initialized, we can now calculate the area of the wall with the calculateArea() function.