The function which can be used to calculate his earnings is the sum of three components.
1. Student earns an hourly rate of $12. If he workes h hours, then he earns $12h per h hours.
2. Student an extra $0.50 for each bakery item he sells. If he sells b bakery items, then he earns $0.50b in total.
3. Student an extra $0.25 for each drink he sells. If he sells d drinks, then he earns $0.25d in total.
Therefore, the function is
