Implement pp6calculator Exercise 5 solution

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