I suck at C++! like really badly, i just cant grasp it, and now i have to write a program for it that is suppose to input some values from a text file that would create like a gradebook thing. im also supposta use a void function, calculatedAverage to determine the average of the five test scores and use a loop to read and sum the first five test scores. Then a value returning function calculatedGrade to determine each students grade in the main function. this is the stuff from the txt file thst needs to be read
StudentData.txt
Johnson 85 83 77 91 76
Aniston 80 90 95 93 48
Cooper 78 81 11 90 73
Gupta 92 83 30 69 87
Blair 23 45 96 38 59
Clark 60 85 45 39 67
Kennedy 77 31 52 74 83
Bronson 93 94 89 77 97
Sunny 79 85 28 93 82
Smith 85 72 49 75 63
and it needs to be outputted looking like a table. i have made numerouse ttempts at makeig this, and i am not getting any help from any of my teachers, they say i must lear i on my own, but i rally am haveing a hard time. this is what i have so far:
#include <iostream>
#include <string>
using namespace std;
void calculateAverage(ifstream& inF, ofstream& outF, double& CAvg);
int main()
{
cout << " Student Test1 Test2 Test3 Test4 Test5 Average Grade" << endl;
}
void calculateAverage(ifstream& inF, ofstream& outF, double& CAvg)
{
std::ifstream in("StudentData.txt",std::ios::in |std::ios::binary);
return 0;
}
as you can see i rally suck, it wont even compile! please someone help, i have to have this done asap! please!
P.S. i also attached the .txt file and the .cpp file please someone help im desperate at this point, ive been working on it for 3 days now!