int fibonacci(int x) // base case if (x <= 1) then return 1 endif // recursive call return fibonacci(x-1) + fibonacci (x-2) end fibonacci ---------------------------- int sumArray(int list[]) return sumArrayR(list, 0) end sumArray int sumArrayR(int[] list, int st) if (st == list.size) then return 0 else return list[st] + sumArray(list, st+1) endif end sumArrayR int sumArray(int[] list) int sum = 0; for (int i = 0; i < list.size; i = i + 1) sum = sum + list[i] end for return sum end sumArray ---------------------------- double average(int a, int b) return (a + b) * 2 end average double average(int a, int b, int c) return (a + b + c) / 3 end average void main() print average(10, 20, 30) double result = average(99,75) end main ---------------------------- // global variable double balance = 0 void deposit() double user = prompt "how much?" balance = balance + user end deposit void withdraw() double user = prompt "how much?" balance = balance – user end withdraw void main() menu() // let user deposit, withdraw print "you have $" + balance end main ---------------------------- boolean checkPal(char word[]) return checkPal(word, 0, word.size-1) end checkPal // overload name boolean checkPal(char word[], int first, int last) // if out of letters or just one letter if (last <= first) then return true else // check current letter pair, then check rest return word[first] == word[last] AND checkPal(word, first+1, last-1) endif end palCheck