<s>[INST] Solving Pinter 7.B.4 with a program Here is exercise 7.B.4 from 'A Book of Abstract Algebra' by Charles C. Pinter.
A solution to this using a C# program is posted.
Is there another good approach using a computer program?
Any language is welcome.

The subgroup of $S_5$ generated by
$
f = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\2 & 1 & 3 & 4 & 5\end{pmatrix}
\qquad
g = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\1 & 2 & 4 & 5 & 3\end{pmatrix}
$
has six elements. List them, then write the table of this group:
$\varepsilon = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\1 & 2 & 3 & 4 & 5\end{pmatrix}$
$f = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\2 & 1 & 3 & 4 & 5\end{pmatrix}$
$g = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\1 & 2 & 4 & 5 & 3\end{pmatrix}$
$h = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\ \, \end{pmatrix}$
$k = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\ \,\end{pmatrix}$
$l = \begin{pmatrix}1 & 2 & 3 & 4 & 5\\ \,\end{pmatrix}$
$
\begin{array}{c|ccc}
\circ & \varepsilon & f & g & h & k & l \\
\hline
\varepsilon \\ f \\ g \\ h \\ k \\ l
\end{array}
$
 [/INST] SageMath provides built-in methods for such computations
sage: S5 = SymmetricGroup(5)
sage: f = S5( (1,2)); g = S5( (3,4,5)) #cycle notation
# or  f = S5([2,1,3,4,5]); g = S5( [1,2,4,5,3])
sage: S5fg = S5.subgroup([f,g])
sage: S5fg.multiplication_table(names='elements')

$$\scriptsize{
\begin{array}{c|*{6}{c}}
{\ast}&()&(3,4,5)&(1,2)&(3,5,4)&(1,2)(3,4,5)&(1,2)(3,5,4)\\\hline
{}()&()&(3,4,5)&(1,2)&(3,5,4)&(1,2)(3,4,5)&(1,2)(3,5,4)\\
{}(3,4,5)&(3,4,5)&(3,5,4)&(1,2)(3,4,5)&()&(1,2)(3,5,4)&(1,2)\\
{}(1,2)&(1,2)&(1,2)(3,4,5)&()&(1,2)(3,5,4)&(3,4,5)&(3,5,4)\\
{}(3,5,4)&(3,5,4)&()&(1,2)(3,5,4)&(3,4,5)&(1,2)&(1,2)(3,4,5)\\
{}(1,2)(3,4,5)&(1,2)(3,4,5)&(1,2)(3,5,4)&(3,4,5)&(1,2)&(3,5,4)&()\\
{}(1,2)(3,5,4)&(1,2)(3,5,4)&(1,2)&(3,5,4)&(1,2)(3,4,5)&()&(3,4,5)\\
\end{array}}
$$
But as @anomaly says in their comment, you don't have to use a computer to do such problems. 
</s>