Question 57512
Well, there are an infinite number of answers to this one, if there are no other constraints to the question.  But, if you assume that the worker's price is a linear function of the time he spends on the job, then the general formula would be:
{{{highlight(P=a*t+b)}}}, where P is total price and t = time.

We have two unknowns, a and b, and two data points, so plug them in and generate two equations:

Eq. 1: $30 for a 2 hour job==> {{{30=a*2+b}}}
Eq. 2: $94 for a 4 hour job==>{{{94=a*4+b}}}
-
Solve Eq.1 for a:
{{{2*a=30-b}}}
Eq. 3: {{{a=(30-b)/2}}}
----
Plug that result into Eq. 2:
{{{94=((30-b)/2)*4+b}}}
{{{94=60-2b+b}}}
{{{highlight(b=-34)}}}
---
Plug that into Eq.3 to get a:
{{{a=(30-(-34))/2}}}
{{{highlight(a=32)}}}
---
So the formula for price, in terms of time is:
{{{highlight(P(t)=32*t-34)}}}
So, for an 8 hour job, the price is: {{{32*8-34=222}}}
.
Here is a graph, note that the formula doesn't make much sense for jobs of less than 1.06 hours.
{{{graph(300,200,-1,10,-25,250,32*x-34)}}}