solution to Q5
question 6 done in php nand phpunit