Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help in c++please for 7 to 9 Accompanying sheet Class Definitions nying sheet contains the definitions of the classes that should be included in n
Help in c++please for 7 to 9
Accompanying sheet Class Definitions nying sheet contains the definitions of the classes that should be included in n booklet. answers on this sheet. jons are listed on the back of this page. 7. Write the code that declares an array of Rectangle objects, and stores in it three rectangles with the following data: length width 1st object 10 15 2nd object 20 10 3rd object 30 30 Note: It's up to you, you can either use an initialization list or assignment statements. th me er th a m : a me a meml 8. Use a for loop to display the areas of the three objects in the array you declared in the previous task. 9. Write six code statements that perform the following steps: a) Declare a pointer ptr that can hold the address of a Rectangle object. b) Dynamically allocates memory for a Rectangle object and assigns its address to ptr. c) Store the value 10 in the length of the rectangle that ptr points to. d) Store the value 12 in the width of the rectangle that ptr points to. e) Display the area of the rectangle on the screen. f) Release the memory you dynamically allocated in step bStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started