This is the question:
Write C++ Console Application to calculate and display the average CGPA of 10 students with the following requirements.
Your program must use Class for student which have the following variables/attributes
Name
MatrixNo
Cgpa.
Your program should get information of 10 students Name,MatrixNo,Cgpa) from User and store it in Arrayof object of type Student (from item 1).
Then, your program must calculate and display the average CGPA from the Array(from item 2).
this is my answer :
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
/* Function Declarations */
char calculateGrade(double);
void calcAverage(ifstream &, int [], int, double &);
void calclasseAverage(ifstream &, int [],double &,double &);
does this file exist in the local directory from where you are running the program, or create your own file and give full path example "c:\\temp\\xyz.txt" instead of maya.txt
By looking at your program, your file operations are not standard, and you dont have any check conditions, that is causing your program to crash, google or search in this website how to read a file.