Average Grade Algorithim (C++)