GradedActivity *grades[NUM_GRADES];


void setLab(GradedActivity *activity)
    { grades[LAB] = activity; }

Totally confused with this one.

If you mean UML diagram, then get Sparx Enterprise Architect and use its reverse engineering capabilities to convert code to UML.

first of all , you need to understand the parts of UML diagrams ,
we have actor , use case , and relationships (for more info search the net)

actors are persons or other softwares/hardwares working with this software

use cases indicate the uses of a program in total , you should ask yourself what does this program do for the actors , then start painting them .

now in order to understand and be able to write a UML diagram you should look into some samples

here take a look =>

I just need to know how to create a class diagram for that particular class... similar to this:

Did I do it right here?
I've attached my UML diagram. Please let me know if it's right or wrong.

class CourseGrades
    // Array of GradedActivity pointers to
    // reference the different types of grades
    GradedActivity *grades[NUM_GRADES];

    // Default constructor
    { for (int i = 0; i < NUM_GRADES; i++)
         grades[i] = NULL;

    // Mutators
    void setLab(GradedActivity *activity)
        { grades[LAB] = activity; }

    void setPassFailExam(PassFailExam *pfexam)
        { grades[PASS_FAIL_EXAM] = pfexam; }

    void setFinalExam(FinalExam *finalExam)
        { grades[FINAL_EXAM] = finalExam; }

    // print function
    void print() const;

That looks pretty correct. You do need an enum to define indexes into grades such as LAB, PASS_FAIL_EXAM, FINAL_EXAM, etc. At least it looks like that's what you need.