Hi, all. I'm given an assignment to create a student grade structure, and calculate the numeric grades and letter grades.
The part I'm having trouble with is that, we are also asked to used a function to catch duplicate student ID. i.e. if one ID has been entered already, we'd tell the user to try another. Then somehow we go back to the loop and record a new student data.(I don't know how to do this part).
Here is what I have done so far:
#include <iostream>
using namespace std;
struct StudentRecord
{
int studentNumber; // as ID
double quiz; // from input
double midterm; // from input
double final; // from input
double average; // calculated and output
char grade; // calculated and output
};
void input2(int index, StudentRecord students[]);
//calculates the numeric average and letter grade.
void computeGrade(StudentRecord& student);
//outputs the student record.
void output(const StudentRecord& student);
int main()
{
const int CLASS_SIZE = 2;
StudentRecord studentAry[CLASS_SIZE];
int index;
cout << "Input " << CLASS_SIZE << " students' Data please...\n\n";