if you don't chage class variables it's better to declare const method: int average() const