user define function trouble!

This is a discussion on user define function trouble! within the C++ Programming forums, part of the General Programming Boards category; i write this program in an excercise.. as a main funtion.. then rewrite it using function call by user define ...

user define function trouble!

i write this program in an excercise.. as a main funtion.. then rewrite it using function call by user define functions. I get lost. Please point out what i am wrong, and be gentle with me cause i am a beginner.. /

the second one does not compile, and give a lots of error vs warning, I think that having trouble with function calls, and passing to main function, but i have no idea to fix cause the book i am studying hasnt clear out much.

summerize what program will do :

open a file with 2 columes; one is letter of f or m (represent for female and male), the other colume is GPA (grade).

read it and sum the gpa of female , sum the gpa of male, and display the everage of female and male gpa.