Question: There are two models for variables: Value model: A variable contains a value. Reference model: A variable refers to an object with a value in
There are two models for variables:
Value model: A variable contains a value.
Reference model: A variable refers to an object with a value in a different location
Given the following pseudocode segment in Ada-like syntax (3 points each. Total 6 points)
type T = record j: integer; end; S = record i : integer; n : T; end; var s1, s2 : S; sl.n.j := 20; s2 : = 1; s2.n.j := 10; writeln (s1.n.j);
a. Please give the output of the code if value model is used for all variables.
b. Please give the output of the code if reference model is used for all variables.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
