A numerical method for solving hyperbolic partial differential equations with piecewise constant arguments and variable coefficients