Mark was caught speeding and the judge wants to make an example out of him. The base fine for speeding is $50 but additional penalties apply in this case.  The fine is increased by $2 for every mile per hour Mark was going over the speed limit. He was going 75 miles per hour in a 30 mile per hour zone. The fine is also doubled because he was in a school zone. Finally, the judge makes Mark pay $300 in court costs and he also has to pay his lawyer $80/hour for three hours of work. How much does Mark owe for this speeding ticket?
First figure out how many miles over the speed limit Mark was going: 75 mph - 30 mph = 
<gadget id="calculator">75-30</gadget>
<output>45</output>
45 mph.
Now figure out how much the per-mile fine is: $2/mph * 45 mph = $
<gadget id="calculator">2*45</gadget>
<output>90</output>
90.
Now add that amount to the base fine: $90 + $50 = $
<gadget id="calculator">90+50</gadget>
<output>140</output>
140.
Now double that amount for being in a school zone: $140 * 2 = $
<gadget id="calculator">140*2</gadget>
<output>280</output>
280.
Now figure out how much Mark owes his lawyer: $80/hour * 3 hours = $
<gadget id="calculator">80*3</gadget>
<output>240</output>
240.
Now add the court costs, lawyer fees and fine: $240 + $300 + $280 = $
<gadget id="calculator">240+300+280</gadget>
<output>820</output>
820.

<result>820</result>