following
Use the following methods trash() and takeOut() to answer questions (a) – (d).
1
public void trash (int x)
12
public int takeOut (int a, int b)
2
{ int m, n;
13
{ int d, e;
3
m = 0;
14
d = 42* a;
4
if (x > 0)
15
if (a > 0)
5
m = 4;
16
e = 2*b+d;
6
if (x > 5)
17
else
7
n = 3*m;
18
e = b+d;
8
else
19
return (e);}
9
n = 4*m;
10
int o = takeOut (m, n);
11
System.out.println ("o is: " + o);}
(a) Draw separate graph for each trash() and takeOut() , then show the connection between them at call site, using the line numbers given on graph’s nodes.
(b) Determine Caller, Callee, Callsite, Actual parameters and Formal parameters, in table.
(c) Give all Coupling DU-pairs of last-defs and first-uses, in table.
(d) find the values of m, n, a, d, b, e and o when x = -1 , 3 , 6 , in table.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images