// DIVE.CPP - Dive class implementation. #include "dive.h" // Constructor. Dive::Dive( float avg, float diff ) { SetJudgeScore( avg ); SetDifficulty( diff ); } // Display the Dive on the console. void Dive::Display() const { cout << "[Dive]: " << judgeScore << ',' << difficulty << ',' << CalcTotalPoints() << endl; } void Dive::SetDifficulty( float diff ) { if((diff >= 1.0) && (diff <= 5.0)) difficulty = diff; else cerr << "Range error in Dive::SetDifficulty()" << " value: " << diff << endl; } void Dive::SetJudgeScore( float score ) { judgeScore = score; } float Dive::CalcTotalPoints() const { return judgeScore * difficulty; }