Menu

[Solved]Write Main Function Declares Array 100 Pointers Pointer Suited Pointing Either Circle Rect Q37251420

Write a main function that declares anarray of 100 pointers such that each pointer is suited to pointingto either a Circle or a Rectangle.

(ii) Initialize each pointer torandomly point to either a Circle (40% of them) or a Rectangle (60%of them). Each Circle or Rectangle should have its colour set to arandom integer between 0 and 8 inclusive. Each Circle should haveits radius set to a random integer between 1 and 10 inclusive andeach Rectangle should have its side length A set to a randominteger between 1 and 10 inclusive and its side length B set to arandom integer between 1 and 10 inclusive.

(iii) Give a single loop that drawsall 100 Circles or Rectangles.

(iv) Give a single loop that destroysall 100 Circles or Rectangles.

It should be written in c++

Expert Answer


Answer to Write a main function that declares an array of 100 pointers such that each pointer is suited to pointing to either a Ci… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *