I think what you are looking for is 5x=300 therefore x=60 so at 60cars he would start to make more.
First do $70(4). That would equal $280. Then do $280+$40=$320
Answer:
Each time, the x is being multiplied by -3 to result in the output.
So for every x input, multiply by -3.
For the y output for 15, you would divide by -3 to find the input x
For example, when 7 is the input, multiply by -3, and the output y would result in -21.
If the sequence is like this, you actually don’t have to
formulate a formula. You just have to formulate a principle. You just have to
remember that when n is an odd number, the value would always be 1. If the n is
an even number, the value would always be 0.
Franck's answer is better (using ~), but I just wanted to point out that the conditional in yours is slightly redundant. It's easy to forget that, since you already have a boolean value, you don't need to perform a comparison in your conditional. So you could have just done this...
<span>if x
x = false;
else
x = true;
<span>end</span></span>