//Header Files #include <iomanip> #include <string> #include <fstream> #include
ID: 3610517 • Letter: #
Question
//Header Files
#include <iomanip>
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
//The Start of the main function
//variable declaration. use 8 because its the number of groupst hatthe grades are sorted into
int counter[8],score,i;
//for infile
ifstream infile;
//For loop
for(i=0;i<8;i++)
counter[i]=0;
//opening the file and inputing the score
infile.open("input.txt");
infile >> score;
//-200 indicates end of text file
//reading scores fromf ile
while (score!=200) // if i just comment this out it will run butits this # here the -999. the rest of the while loopappears fine.
{
i=score/25;
if(i==8)
i--;
counter[i]++;
infile >>score;
} // end while
//variables for ranges
int first=0, last=24;
//For loop
//Outputing scores between ranges
for(i=0;i<8;i++)
{
//Displaying the results
cout << "The Score Between" << first <<"-" << last << endl<< "Is: " <<counter[i] << endl;
first=last+1;
last=first+24;
//If Statment
if(i==6)
last++;
} // end of forloop
//closes the infile
infile.close();
//system pause
system("pause");
return 0;
} //end main