Hi! I am nearly done with this code that needs to read from a text file. However, I keep getting a few errors and I am not sure how to fix them. The errors read as follows: 'AgeAve': undeclared identifier, 'DisplayName':illegal use of type 'void','THREE<n>::DisplayName' looks like a function definition, but nthere is no parameter list; skipping apparent body, 'THREE<n>::DisplayName':initialization of a function.
The text file contains 5 president's names and their age. I need to compute and return their age average and display the name of presidents whose age are above average. Thank you for any tips!
line 16: What is a "person"? You need to define the type before you can use it.
line 38: Missing the template parameter, and inexplicably the function signature has changed to include a string parameter.
lines 44, 55, 66: As a consequence of line 16, "a" does not exist.
Also, include the <cstdlib> for system if you must use it.
You've got errors on multiples of 11 which is kinda spooky :)
If you don't #include <cstdlib>, you'll probably get an error when you call system() in line 31
In member function ComputeAgeAve(), you haven't declared AgeAve before using it. Perhaps change line 50 to float AgeAve = 0; instead of just AgeAve = 0;
Most importantly, you've left out the implementation for your THREE constructor.