Suppose there is such an overhead: does it affect you? In other words, does the use of sqrt() cause your program to fail its performance requirements?
Better than your own? Probably. Better than...
Type: Posts; User: laserlight
Suppose there is such an overhead: does it affect you? In other words, does the use of sqrt() cause your program to fail its performance requirements?
Better than your own? Probably. Better than...
No problem :)
By the way, I would suggest that you use a std::vector<StudentsGrades> instead of a fixed size array. This would make calculateVariance() more reusable (and in the future it would be...
You have a logic error though: !(A || B) = !A && !B, but you transformed it to !A || !B. The use of temporary variables can make the code much easier to read, e.g.,
double...
I would initialise variance to 0.0.
By the way, the if statement is pointless. You could make it useful by negating the condition and doing what's in the current else branch without doing what's...