Set up the following equations:
[tex]x + y = 40[/tex]
[tex]20x + 18y = 770[/tex]
x is the amount of hours worked on the weekday job, and y is the amount of hours worked on the weekend job.
We'll use substitution to remove one of the variables.
Multiply the first equation by -18 to get opposite coefficients for y:
[tex]-18x - 18y = -720
[/tex]
[tex]20x + 18y = 770[/tex]
Combine these two equations together:
[tex]2x = 50[/tex]
Divide both sides by 2 to get x by itself:
[tex]x = 25[/tex]
Plug in x to the first original equation:
[tex]25 + y = 40[/tex]
Subtract 25 from both sides to get y by itself:
[tex]y = 15[/tex]
He worked 25 hours at his weekday job, and 15 hours at his weekend job.