the amount he would have earned if he taught, $12
Explanation:
Opportunity cost is the cost of the next best option forgone when one alternative is chosen over other alternatives
If the writer decides to write, he loses the opportunity to teach and earn $12. This is his opportunity cost.
Also, if he decided to teach instead, his opportunity cost the time he could have spent writing the novel