ITE254: Web Programming 2 3. Given the following secondary function function fun
ID: 3745780 • Letter: I
Question
ITE254: Web Programming 2 3. Given the following secondary function function funStuff (x, y,z)( xy+30; zx+20; y+10; return y And given a segment of the code from a main function var num1 70; var num2- 50; var num3 60; while( num1 > num3) ( iff num2 > num1)( num3 funStuff( num1, num2, num3 ): else f num2 funStufff num1, num2, num3); Il ends while loop Answer the following questions (4 points each) a) What is the final value assigned to num1? b) What is the final value assigned to num2? c) What is the final value assigned to num3?Explanation / Answer
OUTPUT
num1 = 70
num2 = 110
num3 = 170
EXPLANATION
while 70 > 60
if 50 > 70 is flase
else num2 = funStuff(70, 50, 60)
x = 50 + 30 = 80
z = 80 + 20 = 100
y = 100 + 10 = 110 and it is returned
while 70 > 60
if 110 > 70 is true
num3 = funStuff(70, 110, 60)
x = 110 + 30 = 140
z = 140 + 20 = 160
y = 160 + 10 = 170
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.