Call the number of packs of candy bars sold c
If he sold 2 more packs of cookies than candy bars then this would be c+2
Total sales are c x 1.00 plus (c+2)(1.50) which equals 15.50 so
c + 1.5c +3.00= 15.50
2.5c = 12.50
c=5 which is the number of packs of candy bars
c+2 = 7 which is the number of packs of cookies