Question: Question 1 (15 marks) (a) (10 marks) The following programming model contains in its code memory the indicated C program composed of 2 functions. You



Question 1 (15 marks) (a) (10 marks) The following programming model contains in its code memory the indicated C program composed of 2 functions. You will be showing how the working memory is used during the execution of the two functions. Each piece of working memory is associated to a function using a pair of lines. (Note: the first pair of lines associates the piece of working memory allocated to the function main and the second pair of lines associates the piece allocated to the function compute_weight). Show how the given C program affects the contents of the working memory: Show how the structure is organized in the working memory for each function. Show the values are assigned to the members of the structure. Be sure to show all values that are assigned and replaced. Record successive assignments to variables/parameters as follows: variable name 2.6., 10 Show the values are assigned to the members of the structure. Be sure to show all values that are assigned and replaced. Record successive assignments to structure members as follows: Name of structure variable Name of member 1 2 2,6,A, 10 Name of member 222,6, 4 Using arrows show how values are copied between the working memory allocated to the function main and the working memory allocated to the function compute _weight. For copying the contents of a structure variable, you need only used a single arrow. In the console window show the output of the program (b) (5 marks) The following programming model contains in its code memory the indicated C program composed of a single function, main. You will be showing how the working memory is used during the execution of main. Show how the given C program affects the contents of the working memory: Show the values are assigned to the variables and array elements. Be sure to show all values that are assigned and replaced. Record successive assignments to variables/parameters as follows \ 2.6. 10 Vartble name Code Memory Working Memory #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
