Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am new to C++ and need the memory mapped for this program please disreguard wh

ID: 3742176 • Letter: I

Question

I am new to C++ and need the memory mapped for this program please disreguard what I have in the chart already as I think it is incorrect

For the following program examples, fill out the memory table and give the final output of the program.

Note: For simplicity, let’s assume that each variable fills in “one” memory space, including strings. Array elements each have their own memory space.

#include <iostream>

#include <string>

using namespace std;

int main() {

       const int NUM_SIDES = 7;

       double HouseDimensions[] = { 10.34, 6.78, 3.45, 7.89};

      

       double parameterOfHouse = 0.0;

       parameterOfHouse += *(HouseDimensions + 0) * 2;

       parameterOfHouse += *(HouseDimensions + 1) * 2;

       cout << "The parameter of the main house is: " << parameterOfHouse << endl;

       double* LengthOfGuestFront = &HouseDimensions[2];

       double* LengthOfGuestSide = &HouseDimensions[3];

       double parameterGuest = *(LengthOfGuestFront) * 2 + *(LengthOfGuestSide) * 2;

       cout << "The Guest House parameter is: " << parameterGuest << endl;

      

       cout << "";

      

}

Address

0x01

0x02

0x03

0x04

0x05

0x06

0x07

0x08

Name

Num_sides

HouseDimensions[0]

HouseDimensions[1]

HouseDimensions[2]

HouseDimensions[3]

ParameterOfHouse

Value

7

10.34

6.78

3.45

7.89

0.0

Address

0x09

0x10

0x11

0x12

0x13

0x14

0x15

0x16

Name

Value

Address

0x17

0x118

0x19

0x20

0x21

0x22

0x23

0x24

Name

Value

Address

0x25

0x26

0x27

0x28

0x29

0x30

0x31

0x32

Name

Value

Address

0x01

0x02

0x03

0x04

0x05

0x06

0x07

0x08

Name

Num_sides

HouseDimensions[0]

HouseDimensions[1]

HouseDimensions[2]

HouseDimensions[3]

ParameterOfHouse

Value

7

10.34

6.78

3.45

7.89

0.0

Address

0x09

0x10

0x11

0x12

0x13

0x14

0x15

0x16

Name

Value

Address

0x17

0x118

0x19

0x20

0x21

0x22

0x23

0x24

Name

Value

Address

0x25

0x26

0x27

0x28

0x29

0x30

0x31

0x32

Name

Value

Explanation / Answer

Address

0x01

0x02

0x03

0x04

0x05

0x06

0x07

0x08

Name

Num_sides

HouseDimensions[0]

HouseDimensions[1]

HouseDimensions[2]

HouseDimensions[3]

ParameterOfHouse

Value

7

10.34

6.78

3.45

7.89

33.24

Address

0x09

0x10

0x11

0x12

0x13

0x14

0x15

0x16

Name

Value

Address

0x17

0x118

0x19

0x20

0x21

0x22

0x23

0x24

Name

Value

Address

0x25

0x26

0x27

0x28

0x29

0x30

0x31

0x32

Name

Value

Output:

The parameter of the main house is: 33.24

The Guest House parameter is: 22.68

Let me know if you have any classificatios. Thank you

Address

0x01

0x02

0x03

0x04

0x05

0x06

0x07

0x08

Name

Num_sides

HouseDimensions[0]

HouseDimensions[1]

HouseDimensions[2]

HouseDimensions[3]

ParameterOfHouse

LengthOfGuestFront LengthOfGuestSide

Value

7

10.34

6.78

3.45

7.89

33.24

3.45 7.89

Address

0x09

0x10

0x11

0x12

0x13

0x14

0x15

0x16

Name

parameterGuest

Value

22.68

Address

0x17

0x118

0x19

0x20

0x21

0x22

0x23

0x24

Name

Value

Address

0x25

0x26

0x27

0x28

0x29

0x30

0x31

0x32

Name

Value

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote