Consider a square region in the first quadrant of the Cartesian plane whose bottom left and upper right corners have coordinates (0,0) and (100,100), respectively. A text file contains a sequence of...

This is not a graded question so please don't disregard it as if it is.Thank you in advance professor! Note: This should be coded in c and NOT c++Consider a square region in the first quadrant of the Cartesian plane whose bottom left and upper<br>right corners have coordinates (0,0) and (100,100), respectively. A text file contains a sequence of<br>rectangles, one per line, with sides parallel to the Cartesian axes. Each rectangle is identified by<br>the x and y coordinates of the bottom left and upper right corners, reported with spaces as<br>separators. The coordinates are integers between 0 and 100, with extremes included. Write a<br>function:<br>int arealntersection(FILE * fp);<br>that receives as a parameter a pointer to the file (already open) and returns the total area of the<br>intersecting regions (that is, the area of the regions that are covered by at least two rectangles)<br>Example of execution: (for the sake of simplicity, we report a smaller region with x and y<br>coordinates in the interval 0..10)<br>y<br>0 1 2 3 4 5 6 7 8 9 10<br>If the file of the example contains 1 24 4 on the first line (see light-grey rectangle) and 3 3 58 in<br>the second line (see dark-grey rectangle), the total area returned by the function should be 1.<br>1 2 3 4 5 6 7 8 9 10<br>

Extracted text: Consider a square region in the first quadrant of the Cartesian plane whose bottom left and upper right corners have coordinates (0,0) and (100,100), respectively. A text file contains a sequence of rectangles, one per line, with sides parallel to the Cartesian axes. Each rectangle is identified by the x and y coordinates of the bottom left and upper right corners, reported with spaces as separators. The coordinates are integers between 0 and 100, with extremes included. Write a function: int arealntersection(FILE * fp); that receives as a parameter a pointer to the file (already open) and returns the total area of the intersecting regions (that is, the area of the regions that are covered by at least two rectangles) Example of execution: (for the sake of simplicity, we report a smaller region with x and y coordinates in the interval 0..10) y 0 1 2 3 4 5 6 7 8 9 10 If the file of the example contains 1 24 4 on the first line (see light-grey rectangle) and 3 3 58 in the second line (see dark-grey rectangle), the total area returned by the function should be 1. 1 2 3 4 5 6 7 8 9 10

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here