Question: Given the following code: var a=1, b=3, c=4; var d; function calcNow(x, y, z) { var a, b; a = x - 1; b =

Given the following code:

var a=1, b=3, c=4; var d; function calcNow(x, y, z) { 
 var a, b; a = x - 1; b = y + 3; c = a + b; return a + b -c; 
} d = calcNow(a, b, c); 

Calculate the final value of:

d ____________

Indicate which values will the variables x, y, z, w contain after the following code is done executing:

 var x = 2; var y = 4; var w = 3; var z = 1; 
 function calcMega(a,b,c) { var z = a + b; 
 w = z; x = x + c; return x; 

}

 function calcSuper(a,b,c) { x = a + b; 
 x = 1; b = b - 1; return calcMega(1,b,3); 

}

 z = calcSuper(x,y,z); 

Answers: x ______ y ______ w ______ z ______

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!