From the question;
Jeremy purchased x t-shirts at $12 a piece
This implies
Cost of x t-shirts = $12 times x
= $12x
Also
He purchased y sweaters at $45 a piece
This implies
Cost of y swearters = $45 times y
= $45y
Therefore
Total value of purchase = Cost of x t-shirts + Cost of y swearters
Hence
Total value of purchase = $12x + $45y