There are numerous details of immense importance already given in the question. It is important to look at them carefully. Based on those details the answer to the question can be easily determined.
Let us assume the total charges that need to be paid by the customer = x dollars
Percentage of labor cost charged by the mechanic = 15%
Amount of labor cost charged by the mechanic = $45
Then
(15/100) * x = 45
3x/20 = 45
3x = 45 * 20
3x = 900
x = 900/3
= 300 dollars
Then
The charge that the mechanic charged for the parts = (300 - 45) dollars
= 255 dollars
So the mechanic charged an amount of $255 as the charge of the parts. I hope the procedure is clear for you to understand.