A few things here confuses me, first of all:
Code:
void calculatescore(double totalscore, ifstream& infile);
void calculategrade(int grade);
should be placed outside the main scope, next thing you have an int representign the grade, yet a double representing totalscore, now I have no idear how you are planing to count grades, being 4.3 or as we do here, where it ranges from 0 to 13, but if you plan on giving grades of type int, then the totalscore will easily be kept in an int aswell.
Another thing:
Code:
if (studentname == studentname)
...
while (studentname == studentname);
...
if (scores == scores)
is the same as saying:
Code:
if (1)
...
while (1)
...
if (1)
And the calculatescore() and calculategrade(), needs to be made into functions ie:
Code:
void calculatescore(double totalscore)
{
infile.open("g://students.text");
double scores = test1, test2, test3, test4, test5;
... And the code in the functions are way to fscked up to produce what ever you want it to do.
Code:
...
infile >> test1, test2, test3, test4, test5;
while(scores = test1, test2, test3, test4, test5) Won't work, I'm not even sure what you want to achieve with this, but I'm guessing some sort of test for how long your calculation of totalscore should run.
Since I have no idear how your "g://students.text" file looks like I can't say what you're looking for here.. But again I'm guessing it might be the end of file you want to look for.. Or perhaps not.. Another thing, unless you've got a realy screwed up folder on your computer the "g://students.text" wont even exist, "g:\\students.text" might be a better aproach.