Firstly, this question tricks you by putting the "show that r = 30" first - you actually need to find p and q first.
So, firstly, what ARE p and q? Well, p is the vertical translation, that's nothing new. High tide is the highest point, and low tide is the lowest point, so if we take those two and average them out we should get the vertical translation.

Okay, that's it for what you knew before circular function, sorry.

Now, for q. q is what we call the "amplitude" of the function. No, if a circular function represents a "circle", you can think of the amplitude as this circle's "radius". The amplitude is actually the vertical distance from the vertical translation to the functions highest or lowest point. So, if we take the vertical distance, and take away the highest or lowest point, we'll get the distance between the two, yeah? So:

Both gave us 2, so we'll say that q = 2.
So far, our function is
)
. Now, we just need to show that r = 30. Well, we know that t is the time in hours AFTER high tide. So initially, we have high tide. So, at t = 0, D = 7. Now, if we sub this in, it'll work, but this doesn't show us that r = 30, because that'll work for ANY value of r... However, it does say that 6 hours later it's low tide! So, let's work with that:
 = 5 + 2cos(180) = 5 - 2 = 3)
Which is true - so, you've shown that r = 30, answering the question!