Example 6 Given that $x, y, z$ are two non-negative rational numbers, and satisfy $3x+2y+z=5, x+y-z=2$. If $S=2x+y-z$, then what is the sum of the maximum and minimum values of $S$?
(1996, Tianjin City Junior High School Mathematics Competition)
Analysis: By representing the algebraic expression $S$ with one letter and determining the range of this letter, we can find the maximum or minimum value of $S$.
From the given, we solve $y=\frac{7-4 x}{3}, z=\frac{1-x}{3}$, and.
$$
\left\{\begin{array}{l}
\frac{7-4 x}{3} \geqslant 0, \\
\frac{1-x}{3} \geqslant 0, \\
x \geqslant 0.
\end{array} \text { Thus, } \left\{\begin{array}{l}
x \leqslant \frac{7}{4}, \\
x \leqslant 1, \\
x \geqslant 0,
\end{array}\right.\right.
$$

That is, $0 \leqslant x \leqslant 1$.
And $S=2 x+\frac{7-4 x}{3}-\frac{1-x}{3}=x+2$, obviously 2
$\leqslant S \leqslant 3$. Therefore, the sum of the maximum and minimum values of $S$ is 5.