Asymptotic behavior of bounded solutions to a class of second order nonhomogeneous evolution equations