The eigenvalue problem for second-order ordinary differential equation (SOODE) in a finite interval with the boundary conditions of the first, second and third kind is formulated. A computational scheme of the finite element method (FEM) is presented that allows the solution of the eigenvalue problem for a SOODE with the known potential function using the programs ODPEVP and KANTBP 4M that implement FEM in the Fortran and Maple, respectively. Numerical analysis of the solution using the KANTBP 4M program is performed for the SOODE exactly solvable eigenvalue problem. The discrete energy eigenvalues and eigenfunctions are analyzed for vibrational-rotational states of the diatomic beryllium molecule solving the eigenvalue problem for the SOODE numerically with the table-valued potential function approximated by interpolation Lagrange and Hermite polynomials and its asymptotic expansion for large values of the independent variable specified as Fortran function. The efficacy of the programs is demonstrated by the calculations of twelve eigenenergies of vibrational bound states with the required accuracy, in comparison with those known from literature, and the vibrational-rotational spectrum of the diatomic beryllium molecule.