hi

You again creating the object of rectangle and trying to find the area.
Instead in the same for loop while getting the no of rectangles created, get the area and perimeter....