hey i got this program to calculate grades by reading from a file but im getting some error. can anybody help.

#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int highestGrade (int score1, int score2, int score3);// prototype for first function 
char letterGrade (int highscore);// prototype second function

int main(){
    string name;
    int grade1, grade2 , grade3;
    ifstream inputFile;
    if (inputFile.fail())
        cout << "Opening error";
    ofstream outputfile;
    char letter;
    while (!inputFile.eof()){

        inputFile >> name;
        inputFile >> grade1;
        inputFile >> grade2;
        inputFile >> grade3;

        //highestGrade (12,14,15);
        int maxgrade = highestGrade(grade1, grade2, grade3);
        letter = letterGrade(maxgrade);
        // or can use 
        //letter = letterGrade(higestGrade(maxgrade));

        //write your result.

int highestGrade (int score1, int score2, int score3)
    if (score1 >=score2 && score1 >= score3) return score1;
    if (score2 >=score1 && score2 >= score3) return score2;
    if (score3 >=score2 && score3 >= score2) return score3;

char letterGrade (int highscore) {
    if (highscore >= 90 && highscore <=100) return 'A';
    if (highscore >= 80 && highscore <= 89) return 'B';
    if (highscore >= 70 && highscore <= 79) return 'C';
    if (highscore >= 70 && highscore <= 79) return 'D';
    if (highscore < 69) return 'F';

    cout<< highestGrade<<letterGrade;
   return 0;


What error do you get and where?
Also it seems like you are implementing methods inside the method main, perhaps that is your error and what you should do instead is implement them before calling the method main and then make method call to the implemented methods from within main such as:

return random number 1 to 6

   print rollADice()
This article has been dead for over six months. Start a new discussion instead.