This is a problem of proportions
$ 414 ------------------------------ 18h
x ----------------------------- 8h
x = (8 x 414) / 18
x = $184
In 8 hours Ali will make $184.
The first one is not proportional, the second one is proportional
For the second one