• if (dataOK)
• {
• // Calculate average
• average = float(test1 +
test2 + test3) / 3.0;
•
• // Print message
• cout << "Average score is
" << setprecision(2)
• << average <<
"--";
•
• if (average >= 60.0)
• {
• cout <<
"Passing"; // Student is
passing
• if (average < 70.0)
• cout << " but
marginal"; // But
marginal
• cout << '.' <<
endl;
• }
•