View Single Post
Old 05-01-2005, 10:49 AM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
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.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote