You get $20$ cents for each correct answer, but pay $10$ ten cents for each incorrect one. After $30$ questions, you have a profit of $\$1.80$ ... An algebra word problem question in my textbook:

A kind teacher gives you $20$ cents for every question you get right, but you have to pay the teacher $10$ cents for every question you get wrong. After $30$ questions you have made a profit of $\$1.80$.
A) Form an equation with $x$ representing the number of questions you got right.
B) Solve your equation to find how many questions you got right.

I realise this is a very rudimentary question for a Year 10/11 Maths class, but I’m homeschooled with no teaching guidance whatsoever and this question type has no explanation in my textbook. So I super appreciate the help.
What are we looking for ?
the number R of right answers and the number W of wrong answers.
As We have TWO  unknowns, we need TWO equations
What do we know ?
The total number of question, which is  $ 30$
so $$R + W= 30$$
For each good answer, we win $ 20 $ cents. For $  R$ answers. we get $ 20 R$ and for $ W$ answers, we loose $
10 W$ cents which means that we win $ -10W$.
In the end, we have
$$R+W=30$$
$$20R-10W=180$$
Using system of equations, we can derive the values of R and W. We can use substitution, by creating an equation for R from the first equation:
$$R = 30 - W$$
Using this, we can substitute this for R in the second equation:
$$20(30 - W) -10W = 180$$
Now, we have an equation with only W,and we can solve for it:
$$600 - 20W - 10W = 180$$
$$600 - 30W = 180$$
$$-30W = -420$$
$$W = 14$$
Now that we know $$W = 14$$, we can substitute into the equation $$R + W = 30$$ to find that $$R = 16$$. Thus, these are your equations and answers. Since the question explicitly asks to use the variable $x$, use $x$ instead of $R$.
If you answer $x$ many questions right, with that you've earned $20x$ cents.
But this means you also got $30-x$ wrong, for which you paid back $10$ cents each, i.e. a total of $10(30-x)=300-10x$ cents.
So your &quot;profit&quot; in general (in cents) is $$20x - (300-10x)  =20x - 300 + 10x = 30x - 300 = 30(x-10)$$
That answers A.
If this equals $\$1.80 = 180$ cents we have to solve $$180 = 30(x-10) \iff 6 = (x-10) \iff x=16$$
And with $16$ right and $14$ wrong we indeed earn $\$3.20$ and pay $\$1.40$ so the profit is correct.