Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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.

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)
public int takeOut (int a, int b)
{int d, e;
d = 42* a;
if (a > 0)
e = 2*b+d;
else
1
12
13
3
14
4
15
m= 4;
if (x > 5)
n = 3*m;
16
6.
17
e = b+d;
return (e);}
7
18
else
19
n = 4*m;
int o = takeOut (m, n);
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.
9.
10
11
(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.
Transcribed Image Text: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) public int takeOut (int a, int b) {int d, e; d = 42* a; if (a > 0) e = 2*b+d; else 1 12 13 3 14 4 15 m= 4; if (x > 5) n = 3*m; 16 6. 17 e = b+d; return (e);} 7 18 else 19 n = 4*m; int o = takeOut (m, n); 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. 9. 10 11 (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 4 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY