Use the following methods trash() and takeOut() to answer questions (a) – (d).  public void trash (int x) { int m, n; m = 0; if (x > 0)  m = 4; if (x > 5)  n = 3*m;  else n = 4*m; int o = takeOut (m, n); System.out.println ("o is: " + o);} public int takeOut (int a, int b) { int d, e; d = 42* a;  if (a > 0)  e = 2*b+d;  else  e = b+d; return (e);}             (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.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Modularization Techniques
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question

Use the following methods trash() and takeOut() to answer questions (a) – (d).

 public void trash (int x)

{ int m, n;

m = 0;

if (x > 0)

 m = 4;

if (x > 5)

 n = 3*m;

 else

n = 4*m;

int o = takeOut (m, n);

System.out.println ("o is: " + o);}

public int takeOut (int a, int b)

{ int d, e;

d = 42* a;

 if (a > 0)

 e = 2*b+d;

 else

 e = b+d;

return (e);}

 

 

 

 

 

 

(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 CallerCallee, 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.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Methods of StringBuilder class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage