Question: Define a type Rect for rectangles that are parallel to the axes in a Cartesian coordinate system. Represent a rectangle by its lower left and
Define a type Rect for rectangles that are parallel to the axes in a Cartesian coordinate system. Represent a rectangle by its lower left and upper right endpoints using the Point type above. Write a function RECTarea() that takes as parameter a variable of type Rect. The function should compute and return the area of a rectangle. Make use of the function POINTdist() written in question #3 of the Pre-Lab. Write a main program to enter two points from the user, representing the lower left and upper right endpoints of a rectangle. Make use of function RECTarea() to print the area of the rectangle entered. Example Run: Enter the lower left points of your rectangle: -1 3 Enter the upper right points of your rectangle: 5 7 The area of your rectangle is: 24.00
(in C programing language)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
