Quasianalytic and nonquasianalytic solutions for a class of weakly hyperbolic Cauchy problems