After generating rectangles of arbitrary size on a two-dimensional plane, write a program to find the following and show the result. (1) Structure rectangle member composition: center position (x,y), width, height (2) Existence range of rectangle: 0 to 100 in x and y directions (3) Rectangle size: 20≤w,h≤50 (4) Write a program that randomly generates 10 squares and finds Intersection over Union (IoU) between different squares. (Let the two squares be A and B, IoU(A, B) = ?∩?/?∪?) (5) Write the following functions: (a) A function that fills the contents of the structure (b) A function that calculates the IoU of two given rectangles (c) A function that displays the contents of the final structure (d) Other functions necessary for writing programs (6) IoU results between squares are output in the form of 10 X 10 C++ Program source (submit only .c or .cpp)

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
icon
Related questions
Question
1. After generating rectangles of arbitrary size on a two-dimensional plane, write a program to find the following and show the result. (1) Structure rectangle member composition: center position (x,y), width, height (2) Existence range of rectangle: 0 to 100 in x and y directions (3) Rectangle size: 20≤w,h≤50 (4) Write a program that randomly generates 10 squares and finds Intersection over Union (IoU) between different squares. (Let the two squares be A and B, IoU(A, B) = ?∩?/?∪?) (5) Write the following functions: (a) A function that fills the contents of the structure (b) A function that calculates the IoU of two given rectangles (c) A function that displays the contents of the final structure (d) Other functions necessary for writing programs (6) IoU results between squares are output in the form of 10 X 10 C++ Program source (submit only .c or .cpp)
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning