Task 1: Rectangle Area
Task 1: Rectangle Area
Given the coordinates of the bottom-left and top-right corners of two rectangles, calculate total area covered by the two rectangles. The two rectangles may or may not overlap.
Testing Data:
Rectangle 1: Bottom Left: (1,1), Top Right: (3,4)
Rectangle 2: Bottom Left: (2,3), Top Right: (6,7)
Hints:
1. First find the areas of the two rectangles
2. What is wrong with just adding the areas together?
Testing Data:
Rectangle 1: Bottom Left: (1,1), Top Right: (3,4)
Rectangle 2: Bottom Left: (2,3), Top Right: (6,7)
Hints:
1. First find the areas of the two rectangles
2. What is wrong with just adding the areas together?
Similar topics
» Task 4: MasterCoder
» Task 6: The cake is a lie!
» Task 2: Lightposts
» Task 5: As easy as bagels
» Task 3: Cave Troll
» Task 6: The cake is a lie!
» Task 2: Lightposts
» Task 5: As easy as bagels
» Task 3: Cave Troll
Permissions in this forum:
You cannot reply to topics in this forum