Implement pp6calculator Exercise 4 solution

Wrap selection of arithmetic operator, numbers and result output in
while loop to allow repeat operations. Exit loop on user entering
'q' as operator.
Implement pp6calculator Exercise 5 solution

Refactor arithmetic operations into functions taking the input
arguments and returning the result. Calculate results using these
functions.