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.

Recommended Answers

All 3 Replies

Member Avatar

What is your question exactly?

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.