Question: C++ ! Create a Stash class specifically for storing Rect objects and call it RectStash. Add a default constructor and a destructor to correctly initialize
C++ !
Create a Stash class specifically for storing Rect objects and call it RectStash. Add a default constructor and a destructor to correctly initialize your RectStash class. Then write a program that will read several lines as input. Each line will contain 4 floats defining a 2D rectangle in the Rect format described above. Read the rectangles adding them to a RectStash object. Stop reading rectangles when your program loads 4 negative float values. After this point you will start reading a series of 2D points, and for each 2D point you will print the classification of each point in respect to all previously read rectangles. The classification should print "in" or "out" according to its result. Stop your program when you read vector (-99,-99).
Everything should be contained in one file. You may not assume the existance of any header files in your working directory.
Sample Input:
-5 -5 2.5 2.5 5 8 2 2 -1 -1 -1 -1 0 0 -4 -6 6 9 -99 -99
result:
out out in out out out
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
