Menu

(Solved) : Consider Following Jack Function Function Int Foo Var B Sum Let B 10 B Let Sum Sum Let 1 R Q30826651 . . .

Consider the following Jack function:

function int foo() { var a,b,sum ; let b = 10 ; while ( a < b ) { let sum = sum + a ; let a = a + 1 ; } return sum ; }

What sequence of virtual machine commands will implement the twolet statements in the body of the while loop?

Expert Answer


Answer to Consider Following Jack Function Function Int Foo Var B Sum Let B 10 B Let Sum Sum Let 1 R Q30826651 . . .

OR