Every year, Fred pays $6,000 in state income taxes for the first $22,000 he earns and $0.50 for every additional dollar he earns beyond $30,000. If he earns × dollars and ×> 22,000, write an functions that gives the amount of income tax Fred pays for annually.