joe spent $27 for wallet and belts.walllet cost 2/7 as much as belt.How much wallet cost?

If the belt cost b, then the wallet cost 2/7 b. So, we have

b + 2/7 b = 27
9/7 b = 27
b = 27 * 7/9 = 21
the wallet cost 2/7 * 21 = 6

Or, since the wallet cost 2/7 as much as the belt, the belt cost 7/2 as much as the wallet. Now you can find w directly, since if the wallet cost w, then

w + 7/2 w = 27
9/2 w = 27
w = 27 * 2/9 = 6