Computers
posted by Dave on .
Show what the final output of this function will be. The answer will be in the form x * Z  y
Private Function F(x as Int, y As Int, z as Int)
If (y = 1) then
Return 2
Else
Return x * Z  y + F(x1,y1, z)
End If
End Function

if this is your code
Private Function F(x as Int, y As Int, z as Int)
If (y = 1) then
Return 2
Else
Return x * Z  y + F(x1,y1, z)
End If
End Function
what is your test data. if you test this code with y=1 then you will get an answer of 2, else Return x * Z  y + F(x1,y1, z) 
The test data I'm using is y = 3. I tried using a trace table, but I get back to 2. Not sure how to get an answer in the form x * Z  y. Any help will be much appreciated.
Thanks