Show the symbol table for the following function. Assume that double variables t
ID: 3889175 • Letter: S
Question
Show the symbol table for the following function. Assume that double variables take up two locations in memory. Include a + for positive offsets and a - for negative offsets. Hint: Draw the activation record.
double cubic(double x, int a, int b, int c, int d)
{
double y = 0.0;
y = a*x*x*x + b*x*x + c*x + d;
return y;
}
Name
Scope
Size
Offset
x
cubic/local
a
cubic/local
b
cubic/local
c
cubic/local
d
cubic/local
y
cubic/local
QUESTION 1:
(1)
QUESTION 2:
(11)
QUESTION 3:
(2)
QUESTION 4:
(22)
QUESTION 5:
(3)
QUESTION 6:
(33)
QUESTION 7:
(4)
QUESTION 8:
(44)
QUESTION 9:
(5)
QUESTION 10:
(55)
QUESTION 11:
(6)
QUESTION 12:
(66)
Name
Scope
Size
Offset
x
cubic/local
(1) (11)a
cubic/local
(2) (22)b
cubic/local
(3) (33)c
cubic/local
(4) (44)d
cubic/local
(5) (55)y
cubic/local
(6) (66)Explanation / Answer
double cubic(double x, int a, int b, int c, int d)
{
double y = 0.0;
y = a*x*x*x + b*x*x + c*x + d;
return y;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.