The position of a particle attached to a vertical spring is given by

y = (y0 cos 𝜔t)j. The y axis points upward, y0 = 18.3 cm, and 𝜔 = 17.65 rad/s.
(a) Find the displacement of the particle during the time interval from
t = 0 to t = 8.9 s. (Round your answer to the nearest integer.)

(b) Find the distance (in centimeters) the particle traveled during this time interval.

(a) that would be just y(8.9) - y(0)

(b) since the period is 2π/17.65 = 0.355 seconds, the particle passes through 8.9/0.355 = 25.05 complete cycles.
Each cycle covers 2*18.3 cm, so that would make 916.83 cm