Approximating the Riemann-Stieltjes integral in terms of generalized trapezoidal rules