Explanation:
Revenue minus cost of sales is equal to gross profit
so inventory purchase, beginning inventory and ending inventory are in cost of sales
Formula will be Revenu-cost of sales (beginning inventory + purchased inventory - ending inventory )=Gross profit
So 500000-(40000+x-45000)=150000
then you can make x as the subjects of the formula and you can easily get the answer