ICS4M1 Is it a Function? Does it call itself?

advertisement
ICS4M1
Is it a Function?
Does it call itself?
change
Is there an Exit condition?
Does the Pereameter
1.Create a Recursive Function “MYSUM” that will sum the numbers from 0 to 20.
Function MySum(Value as integer) as Integer
? ? ? ? ?
End Function
2. Create a Recursive function that will display the following sequence on the
screen
1+1+2+3+5+8+13+21
Print NewSum(21)
output: 58
1*1*2*3*5*8*13*21
Print NewProcuct(21)
output: 65520
3. Create a Recursive program that will output the letters in a word in reverse
order.
‘What does this Non-Recursive program do? <f1>=Help
Print RevWord(“This is a test”)
For Y = 1 to len(“This is a test”)
Output = “tset a si sihT”
Print Mid(“This is a test”,Y,1)
Next Y
4. Create a Recursive program that will have an object (picture?) move down the
screen.
5. Create a Recursive Binary Search.
6. Create a SORT with Recursion.
Is it a Function?
Does it call itself?
change
Is there an Exit condition?
Does the Pereameter
1. Create a Recursive Function “MYSUM” that will sum the numbers from 0 to 20
Function MySum(Value as integer) as Integer
? ? ? ? ?
End Function
2. Create a Recursive function that will display the following sequence on the
screen
1+1+2+3+5+8+13+21
Print NewSum(21)
1*1*2*3*5*8*13*21
Print NewProcuct(21)
3. Create a Recursive program that will output the letters in a word in reverse
order.
‘What does this Non-Recursive program do? <f1>=Help
For Y = 1 to len(“This is a test”)
Print RevWord(“This is a test”)
Print Mid(“This is a test”,Y,1)
Output = “tset a si sihT”
Next Y
4. Create a Recursive program that will have an object (picture?) move down the
screen.
5. Create a Recursive Binary Search.
6. Create a SORT with Recursion.
Download