#include<iostream> #include<fstream> using namespace std; struct students{ int ID; int q1; int q2; int e1; int e2; int assg1; int assg2; int assg3; }; int main(){ int ID; char command; students grades[Num_grades]; int i =0; int Num_Students = 65; while(!infile.eof()){ infile >> grades[i].ID; infile >> grades[i].q1; infile >> grades[i].q2; infile >> grades[i].e1; infile >> grades[i].e2; infile >> grades[i].assg1; infile >> grades[i].assg2; infile >> grades[i].assg3; i++; } ifstream infile; infile.open("grades.txt"); ofstream outfile; outfile.open("report.txt"); do{ cout << "0: Publish grade report" << endl; cout << "1: Search for student grade by ID" << endl; cout << "2: Sort grades" << endl; cout << "3: Projected grade" << endl; cout << "4: Distribute grades" << endl; cout << endl; cout << "Enter an operator: "; cin >> command; switch (command) { case '0': for(int j = 0; j<0;j++){ outfile << grades[j]; j++; } break; case '1': cout << "Enter an ID" << endl; cin << ID; int searchList(int grades[], int Num_Students, int ID){ int index = 0; bool found =false; while (index < Num_Students && !found){ if (grades[index] == ID){ found = true; cout << grades[].q1; cout << grades[].q2; cout << grades[].e1; cout << grades[].e2; cout << grades[].assg1; cout << grades[].assg2; cout << grades[].assg3; } index++; } } break; case '2': break; case '3': cout << "Enter an ID" << endl; cin >> ID; int LAB =15; int searchList(int grades[], int Num_Students, int ID){ int index = 0; bool found =false; while (index < Num_Students && !found){ if (grades[index] == ID){ found = true; int total = (grades[].q1+grades[].q2 +grades[].e1+grades[].e2+grades[].assg1+grades[].assg2+grades[].assg3)*0.1 + ((grades[].e1+grades[].e2)/2)*.15 + LAB } index++; } if (total < 60){ cout << "You have an F" << endl; else if(total <69) cout << " You have an D" << endl; else if(total < 79) cout << "You have an C" << endl; else if(total < 89) cout << "You have an B" << endl; else if( total <= 100) cout << "You have an A" << endl; } }

I have not done case 0 or case 4 for yet because it is not complete. So, can anyone help me to see if I am going in the right direction or if something is wrong with the program? Also, I am supposed to store the data in an array of structs and manipulate it as the program requires.