write a program to calculate the area and perimeter of a rectangle .