After the data file is generated, How do I print thecontent to the black pop up
ID: 3617385 • Letter: A
Question
After the data file is generated, How do I print thecontent to the black pop up screen.#include<fstream>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
int ID, amountofstudents;
double Grade;
string Name;
ifstream III;
ofstream OOO;
OOO.open ("grade.dat");
cout<<"Please enter amount of students"<<endl;
cin>>amountofstudents;
OOO<<setw(10)<<"ID"<<setw(10)<<"Name"<<setw(10)<<"Grade"<<endl;
for( int i=0; i< amountofstudents ; ++i )
{
cout<<"Please enter ID of student."<<endl;
cin>>ID;
cout<<"Please enter Name of student"<<endl;
cin>>Name;
cout<<"Please enter grade of student"<<endl;
cin>>Grade;
while (Grade<0 || Grade>100)
{
cout<<"Unable to calculate, please enter gradeagain"<<endl;
cin>>Grade;
}
OOO<<setw(10)<<ID<<setw(10)<<Name<<setw(10)<<Grade<<endl;
}
OOO.close();
III.open("grade.dat");
system("pause");
return 0;
}