Finished basic code for exercise 3

do not get correct out put for input of x=3