She spent a total of $21 dollars.
The soda cost $3
Then, she bought 7 candy bars for x dollars
We set x because we don't know the price
3 + 7x = 21
Solve the equation for x
Subtract both sides by 3
3-3 + 7x = 21 -3
7x = 18
Divide both sides by 7
7x/7 = 18/7
x= 2.571
Each candy bar cost 2.57 aprox