I have to create two methods called computeGrade. One of the computeGrade method takes in a double argument and converts the marks into grade (A, B, C, D, F) and set the value to grade attribute. Another computeGrade method takes in a string argument which is either “Pass” or “Fail” for a non-graded pass student and converts the result into grade (P or F) and set the value to grade attribute. The method that i'm having problem with is the string argument.
What does it do that you don't like, or what does it not do that wish it did do?
myStudent.push_back(new Student("Kate Sun", "Basic Accounting", pass));
This looks wrong. The third parameter in the Student constructor function is a double, but you're trying to use the variable pass, which doesn't exist. What is pass? What are you trying to do? Likewise the one where you try to use the non-existent variable Fail. In C++, variables must exist before you can use them.
Likewise on lines 43 and 46, where you try to use the variables pass and fail. Those variables don't exist. Step back and think about what you're trying to do here. That function makes little sense. Surely it's meant to take a numerical score in (not a string), and check if that numerical score is above a certain value.
I see you're using a vector of pointers-to-student. Why? Why not just use a vector<Student>?