7. (10%) Consider the following program segment. Let n be a positive integer. Find the final values of a and b as functions of n.