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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

(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
Transcribed Image Text: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
9.92
10
6.32
4.6
10.9
6.9
12.0
6
Transcribed Image Text:9.92 10 6.32 4.6 10.9 6.9 12.0 6
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Files and Directory
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education