problem solving using quadratic equations help

having a hard time figuring this one out....

Olivia designs and sales necklaces. The material for each necklace costs $4. She sells an average of 40 necklaces a week for $8 each. She would like to raise the price, but for each $0.50 increase she would lose four sales each week.

a) Write an expression to represent the price of each necklace.

b) Write an expression to represent the number of necklaces sold per week.

c) Use your answers in a and b to write an expression that represents Olivia's revenue from the sales of her necklaces.

d) Write an expression to represent the cost of the materials for the necklaces.

e) Use your answers from c and d to write an equation for Olivia's profit.

f) What selling price will give Olivia the largest profit?

g) What will her profit be?

h) How many necklaces must she sell to earn this profit?

I kinda got stuck on question d. Any help would be great.