void finalExam::set(int nquestions, int nmissed) { double numScore; // To hold the numeric value // Set the number of questions and number missed numQ = nquestions; missed = nmissed; // Calculate the points for each question points = 100.0 / numQ; // Calculate the score for this exam score = 100.0 - (missed * points); // The the inherited setScore function to set the numeric score setScore(score); // Call the adjustScore function to adjust the score adjustScore(); }
/******************************************************************************* Name: ~Enemy Description: Destructor ******************************************************************************/ Enemy::~Enemy() { numEnemies--; adjustScore(100); }