Calculate the area of squares and rectangles