Calculate basic and total pay using functions.