this is what the question said.

// 9-1. Reimplement the Student_info class so that it calculates the 
// final grade when reading the student's record, and stores that grade 
// in the object. Reimplement the grade function to use this
// precomputed value.

this is what I thought!

1. Reimplement Student_info class
1.1 calculate the final grade WHEN reading the student's record

2. store the result in an object.

3. reimplement grade function to use this precomputed value.

But, I thought the final grade is the returned result from the grade function. but now, on "3." it's telling me to reimplement grade function to use the "precomputed value".

There is also one variable named "final" referring to the final exam grade but the data taken raw from the user's input which is not seem to fit with "calculates" as it said in the exercise!

the code.

4 Years
Discussion Span
Last Post by Vasthor

Most user input is a string. You probably have to cast the input to a number before you do your calculations.

Edited by tinstaafl


my question is "What is the exercise's question?"

the input(for grade etc) is assumed to be numbers in the first place.
I'm sure it's more like reimplement the class so it use the grade function (to calculate the final result) just after reading those records. But then, the last instruction ("3."), confused me altoghether.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.