3.1 Q: Write a function bandit() that takes a string argument and returns a string where every consonant "x" has been replaced by "xox". A: I have used the PHP language here - one of its functions, str_replace(), is very helpful in this problem. The result is "a wowomomboblole isos sositottotinongog hoherore". The script works for lower-case letters only, but this could be easily changed. The code is somewhat brute-force. 3.2 Q: Write a function f() that takes four integer arguments: a, b, c and d. If a and b are both even and c is positive, or if a and b are both odd and d is negative, return 1. Otherwise, return 0. A: I have used a pseudo-code similar to the BASIC programming language for the answer. One of BASIC's functions is x = int(x), which (in the case of my answer) checks whether x is an integer. input A,B,C,D let A/2 = X let B/2 = Y if X = int(X) and Y = int(Y) and c > 0 or X != int(X) and Y != int(y) and d < 0 then print "1" else print "0"