The variables representing the total cost of the items bought are x and y.
Where X is the total cost of the items bought during the first trip and Y is the total cost of the items bought during the second trip.
Items bought on the first trip:
Boards = 15
Boxes of nails = 3
Total cost = x
Items bought on the second trip:
Boards = 9
Boxes of nails = 1
Total cost = y
Variables:
Let a piece of board = b
Let a box of nails = n
Let the total cost for the first trip = x
Let the total cost for the second trip = y
Equations:
x = 15b + 3n
y = 9b + n