Tommy ordered sandwiches for his friends. The veggie sandwiches cost $4 apiece and the meat sandwiches cost $9 apiece. Tommy ordered 6 sandwiches and paid $39. How many of each type of sandwich did he order?

Given,

Cost of veggie sandwich = $4
Cost of meat sandwich = $9
total paid = $39
let he ordered
x veggie & y meat sandwiches
∴ 4x + 9y = 39 —- (1)
x + y = 6 (given)
y = 6 - x —- (2)
(2) in (1)
4x + 9 (6 - x) = 39
4x + 54 - 9x = 39
5x = 15
x = 3
from (2), y = 3
∴ 3 veggie sandwiches
& 3 meat sandwiches were ordered.