Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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 b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

The location of the neuro centre activity of the heart is.......?

Answered: 1 week ago