CODE
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
int let2num();
int main ()
{
float GPA, grades, classes;
int letters;
ifstream inFile;
ofstream outFile;
inFile.open ("indata2.txt");
if (!"indata2.txt")
{
cout << "Input file not found."<<endl;
return 0;
}
outFile.open ("outdata2.txt");
if (!"outdata2.txt")
{
cout << "output file not found."<<endl;
return 0;
}
let2num(letters);
if (letters>=1)
{
GPA = letters/classes;
}
else (letters<=0)
{
cout<<letters<<"This grade will not be counted for the GPA."<<endl;
}
return 0;
}
hi guys im doing program to calculate the GPA but i need to extract the grades from a file and show the number of grades my doubt was how do i read the letters from a file and assign them numbers and how do i count them sorry if i have gramatical errors but irecently move to the us thank u! XD