Answer: Total cost when over by 4 gb: 70 dollars
Total cost when over by xx gb: (30+10*xx) dollars
Explanation: He used 30 dollars plan which had 6 gb. Eventually he used 4gb over limit. According to question, it would cost 10 dollars more per gb if used above limit.
He used 4 gb more than limit. Hence,
it would cost him (4*10) dollars more. Thus total cost is (30+4*10) i.e. 70 dollars.
For the next sub-question, using the same logic, we get the expression and the final answer as:
(30+10*xx) dollars.