Problem 4. Declared variables and added formula for total amount spent.