I do not know how to start this (and I can\'t use arrays): // Program Average ca
ID: 3627488 • Letter: I
Question
I do not know how to start this (and I can't use arrays):// Program Average calculates the average of five test scores where the
// lowest score is dropped for each student. The program also calculates
// a class average.
#include <iostream>
#include <conio.h>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
// void function prototypes go here
int main()
{
ifstream inData; // input file
ofstream outData; // output file
string studentID; // student ID number
int numStudents; // number of students in file
int t1; // test 1 score
int t2; // test 2 score
int t3; // test 3 score
int t4; // test 4 score
int t5; // test 5 score
int lowestTest; // lowest test score
double average; // average of 4 highest tests
double sumOfAverages; // sum of the averages of all students
double classAverage; // average for class
inData.open("e:\chap7\data1.txt"); //CHANGE THE PATH FOR YOUR STORAGE DEVICE
outData.open("e:\chap7 esults.txt"); //CHANGE THE PATH FOR YOUR STORAGE DEVICE
outData << fixed << showpoint;
Initialize(numStudents, sumOfAverages);
GetData(inData, studentID, t1, t2, t3, t4, t5);
if (!inData)
{
cout << "File not found" << endl;
getch();
}
else
{
while (inData)
{
FindLowest(t1, t2, t3, t4, t5, lowestTest);
CalcAverage(t1, t2, t3, t4, t5, lowestTest, average);
PrintResults(outData, studentID, t1, t2, t3, t4, t5, average);
AccumulateClassInfo(numStudents, average, sumOfAverages);
GetData(inData, studentID, t1, t2, t3, t4, t5);
}
}
CalcClassAverage(numStudents, sumOfAverages, classAverage);
PrintClassInfo(outData, numStudents, classAverage);
return 0;
}
//**********************************************************************
// Initialize function heading goes here
//Preconditions: none
//Postconditions: The counter and accumulator are set to zero
{
// function body goes here
}
//**********************************************************************
// GetData function heading goes here
//Preconditions: The file is open and ready to be read from
//Postconditions: The studentID and the five test grades have been read
{
// function body goes here
}
//**********************************************************************
// FindLowest function heading goes here
//Preconditions: The five test grades have been read
//Postconditions: The lowest grade is found
{
// function body goes here
}
//**********************************************************************
// CalcAverage function heading goes here
//Preconditions: The five test grades have been read
// The lowest test grade is known
//Postconditions: The average of the four best grades is calculated
{
//function body goes here
}
//**********************************************************************
// PrintResults function heading goes here
//Preconditions: The output file is open and ready to be written to
// The student ID and the five test grades have been read
// The average of the four best test grades has been calculated
//Postconditions: The student ID, the five test grades, and the calculated
// average (with 2 decimal points) have been written to a file
{
//function body goes here
}
//**********************************************************************
// AccumulateClassInfo function heading goes here
//Preconditions: The current number of students is known
// The current accumulated average is known
//Postconditions: The number of students is incremented
// The new average is added to the total
{
// function body goes here
}
//**********************************************************************
// CalcClassAverage function heading goes here
//Preconditions: All data has been process and the number of students
// and the sum of class averages is known
//Postconditions: The class average is calculated
{
// function body goes here
}
//**********************************************************************
// PrintClassInfo function heading goes here
//Preconditions: The output file is open and all data has been processed
// The number of students and the class average is known
//Postconditions: The number of students and class average (with 2 decimal
// places) has been written to the file
{
// function body goes here
}
Please help.