This is for devc++ version 5.11) Create a text file with following data to test your code. Read the following data from this text file: Johnson 85 83 77 91 76 Aniston 80 90 95 93 48 Cooper 78 81 11 90 73 Gupta 92 83 30 69 87 Blair 23 45 96 38 59 Clark 60 85 45 39 67 Kennedy 77 31 52 74 83 Bronson 93 94 89 77 97 Sunny 79 85 28 93 82 Smith 85 72 49 75 63 Using the data above your output should be:(Check picture) Please use this as reference: // 1. declare an array of 20 scores and input the scores from a files scores.txt // 2. Declare the arrays GradeA, GradeB, GradeC, GrddeD and Failed // 3. Declare the necessary counters // 4. Write the code to read these scores and add the scores greater than 90 to array called GradeA //Write the code to read these scores and add the scores greater than 80 less 90 to array called GradeB //Write the code to read these scores and add the scores greater than 70 less than 80 to array called GradeC //Write the code to read these scores and add the scores greater than 60 less then 70 to array called GradeD ////Write the code to read these scores and add all the rest of scores to array called Failed //5. Then dosplay all these arrays const int SIZE =20; #include using namespace std; #include int main(){ ifstream inputFile; double scores[SIZE]; int scoreCounter=0; //Declare the 5 arrays here double gradeA[SIZE]; int counterA=0; double gradeB[SIZE]; int counterB=0; double gradeC[SIZE]; int counterC=0; double gradeD[SIZE]; int counterD=0; double gradeF[SIZE]; int counterF=0;inputFile.open("Scores.txt"); while (!inputFile.eof() ){ inputFile >> scores[scoreCounter]; scoreCounter++; } inputFile.close(); // Add the code here to put the scores into those 5 arrays for (int i = 0; i= 90){ gradeA[counterA] = scores[i]; counterA ++; } else if (scores[i] >= 80){ gradeB[counterB] = scores[i]; counterB ++; } else if (scores[i] >= 70){ gradeC[counterC] = scores[i]; counterC ++; } else if (scores[i] >= 60){ gradeD[counterD] = scores[i]; counterD ++; } else { gradeF[counterF] = scores[i]; counterF ++; } } //Print the contents of scores array for (int i=0;i
(This is for devc++ version 5.11)
Create a text file with following data to test your code. Read the following data from this text file:
Johnson 85 83 77 91 76
Aniston 80 90 95 93 48
Cooper 78 81 11 90 73
Gupta 92 83 30 69 87
Blair 23 45 96 38 59
Clark 60 85 45 39 67
Kennedy 77 31 52 74 83
Bronson 93 94 89 77 97
Sunny 79 85 28 93 82
Smith 85 72 49 75 63
Using the data above your output should be:(Check picture)
Please use this as reference:
// 1. declare an array of 20 scores and input the scores from a files scores.txt
// 2. Declare the arrays GradeA, GradeB, GradeC, GrddeD and Failed
// 3. Declare the necessary counters
// 4. Write the code to read these scores and add the scores greater than 90 to array called GradeA
//Write the code to read these scores and add the scores greater than 80 less 90 to array called GradeB
//Write the code to read these scores and add the scores greater than 70 less than 80 to array called GradeC
//Write the code to read these scores and add the scores greater than 60 less then 70 to array called GradeD
////Write the code to read these scores and add all the rest of scores to array called Failed
//5. Then dosplay all these arrays
const int SIZE =20;
#include <iostream>
using namespace std;
#include <fstream>
int main(){
ifstream inputFile;
double scores[SIZE];
int scoreCounter=0;
//Declare the 5 arrays here
double gradeA[SIZE];
int counterA=0;
double gradeB[SIZE];
int counterB=0;
double gradeC[SIZE];
int counterC=0;
double gradeD[SIZE];
int counterD=0;
double gradeF[SIZE];
int counterF=0;inputFile.open("Scores.txt");
while (!inputFile.eof() ){
inputFile >> scores[scoreCounter];
scoreCounter++;
}
inputFile.close();
// Add the code here to put the scores into those 5 arrays
for (int i = 0; i<SIZE; i++){
if (scores[i] >= 90){
gradeA[counterA] = scores[i];
counterA ++;
}
else if (scores[i] >= 80){
gradeB[counterB] = scores[i];
counterB ++;
}
else if (scores[i] >= 70){
gradeC[counterC] = scores[i];
counterC ++;
}
else if (scores[i] >= 60){
gradeD[counterD] = scores[i];
counterD ++;
}
else {
gradeF[counterF] = scores[i];
counterF ++;
}
}
//Print the contents of scores array
for (int i=0;i<SIZE;i++)
cout << scores[i]<<" ";
cout << endl;
cout << endl << "The value of gradeA = ";
for (int i = 0; i<counterA; i++){
cout << gradeA[i] <<",";
}
cout << endl << "The value of gradeB = ";
for (int i = 0; i<counterB; i++){
cout << gradeB[i] <<",";
}
cout << endl << "The value of gradeC = ";
for (int i = 0; i<counterC; i++){
cout << gradeC[i] <<",";
}
cout << endl << "The value of gradeD = ";
for (int i = 0; i<counterD; i++){
cout << gradeD[i] <<",";
}
cout << endl << "The value of gradeF = ";
for (int i = 0; i<counterF; i++){
cout << gradeF[i] <<",";
}
}
![CUserssadanDoamentscsct33ymintapesChapter BEercise 13main.ase
Test 1 Test 2 Test 3 Test 4 Test 5
Average
82.40
Grade
Dohnson
Aniston
Cooper
Gupta
Blair
Clark
kennedy
Bronson
85.00
83.00
77.00 91.00
76.00
98.e0
95.ee
93.00
48.e0
81.20
78.e0 81.ee
11.0e se.0e
73.e0
66.60
92.00
83.00
45.00
30.ee
69.00 87.8e
72.20
52.20
23.00
96.00
38.00 59.00
68.00
85.e0
45.00
39.00
67.00
77.e0
31.ee
52.00
74.00 83.ee
63.48
93.0e
94.00
89.0e
77.00 97.8e
9e.00
Sunny
Snith
79.00
85.00
28.00
49.00 75.00 63.00
93.00
82.00
85.00
72.00
68.
Class average: 70.94
Process exited after 0.06594 seconds with return value e
Press any key to continue -
ENG
247 PM
12/3/2020](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1def9bcf-e0b6-4f3f-82a1-faee2a34286b%2F2b94d3db-4137-4cab-bce9-b203cc8d0c58%2F4wrc7t_processed.png&w=3840&q=75)
![9.92
10
6.32
4.6
10.9
6.9
12.0
6](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1def9bcf-e0b6-4f3f-82a1-faee2a34286b%2F2b94d3db-4137-4cab-bce9-b203cc8d0c58%2Faknnnlm_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Fundamentals of Information Systems](https://www.bartleby.com/isbn_cover_images/9781305082168/9781305082168_smallCoverImage.gif)
![New Perspectives on HTML5, CSS3, and JavaScript](https://www.bartleby.com/isbn_cover_images/9781305503922/9781305503922_smallCoverImage.gif)
![Fundamentals of Information Systems](https://www.bartleby.com/isbn_cover_images/9781305082168/9781305082168_smallCoverImage.gif)
![New Perspectives on HTML5, CSS3, and JavaScript](https://www.bartleby.com/isbn_cover_images/9781305503922/9781305503922_smallCoverImage.gif)