howdy!
lets set up a proportion based on the amount you earned and the rate you charge:
let x be the number of hours you babysat.
you earned $17.50 for x hours, and you charge $7.00 for 2 hours.
so, we can set up the proportion:
$\frac{17.50}{x} = \frac{7.00}{2}$
cross-multiply to solve for x:
$17.50 * 2 = 7.00 * x$
$35 = 7x$
divide both sides by 7:
$x = \frac{35}{7}$
$x = 5$
you babysat for 5 hours.