1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
//This program accepts a students name, 3 test scores, and number of absences.
//Then converts them into a final grade which will be labeled as successful or unsuccesful
#include "StudentInfo.h"
#include<iostream>
#include<string>
#include<cmath>
#include<iomanip>
#include<sstream>
#include<fstream>;
using namespace std;
//Function Prototypes
void inputInfo(string& studentName, double &testScore1, double &testScore2, double &testScore3, double &absent);
void performCalcs(StudentInfo anStudent);
int main()
{
ifstream inputFile;
inputFile.open("studentdata.txt");
//File open error
if (inputFile.fail())
{
cout << "ERROR: 'studentdata.txt' not found" << endl;
cout << endl;
}
//Local Variables
string lastName, fmName, letterGrade, line;
double testScore1, testScore2, testScore3, absent, testAvg;
//Get lines from file
getline(inputFile, line);
while(!inputFile.eof())
{
void splitLine(StudentInfo anStudent);
}
//Constructor with parameters
StudentInfo anStudent(lastName, fmName, letterGrade, testScore1, testScore2, testScore3, absent);
|