Thanks, that clears up some of my confusion. In this example my book gives me, I noticed that setprecision() takes a 3 and then later a streamtype value, so is it an overloaded function?
streamsize prec = cout.precision();
cout << "Your final grade is " << setprecision(3)
<< 0.2 * midterm + 0.4 * final + 0.4 * median
<< setprecision(prec) << endl;