We are given

we know that

so, we get
opposite =7
adjacent=24
now, we can find hypotenuse


now, we can draw triangle and then switch vertices accordingly
we can find cos(B) using second triangle

In second triangle:
adjacent=7
hypotenuse =25
so, we get
................Answer
1 gallon = 8 pints, so 2 gallons = 16 pints.
If each container can hold one pint, then she will need 16 containers.