Inequalities for the Riemann-Stieltjes integral of midpoint separated functions with applications