Create a text file with following data to test your code. Please use array of structure and try to use functions and pass array of structures to functions. 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

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. Please use array of structure and try to use functions and pass array of structures to functions. 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

 

LOOK AT PICTURES

Name
Dohnson
Aniston
Test 1 Test 2 Test 3 Test 4 Test 5
85.00
se.00
Average
Grade
83.00
77.00
91.00
76.00
98.e0
93.ee
48. ee
81.ee
83.00
Соорer
Supta
Blair
clark
Kennedy
Bronson
Sunny
Snith
78.e0
73.00
87.00
96.00 38.0e 59.00
11.00
se.ee
66.68
D
92.00
30.00
69.00
72.20
52.20
23.00
68.00
45.00
85.e0
45.00
39.00
67.e0
59.28
77.ee
31.ee
52.00
74.00
83.80
63.48
D
93.00
79.00
94.00
89.00
77.00
97.e0
9e.00
8s.ee
72.00
28.00
93.00
75.00
82.00
73.40
68.88
85.00
49.00
63.00
Class average: 70.94
Process exited after e.06594 seconds with return value e
Press any key to continue .
Transcribed Image Text:Name Dohnson Aniston Test 1 Test 2 Test 3 Test 4 Test 5 85.00 se.00 Average Grade 83.00 77.00 91.00 76.00 98.e0 93.ee 48. ee 81.ee 83.00 Соорer Supta Blair clark Kennedy Bronson Sunny Snith 78.e0 73.00 87.00 96.00 38.0e 59.00 11.00 se.ee 66.68 D 92.00 30.00 69.00 72.20 52.20 23.00 68.00 45.00 85.e0 45.00 39.00 67.e0 59.28 77.ee 31.ee 52.00 74.00 83.80 63.48 D 93.00 79.00 94.00 89.00 77.00 97.e0 9e.00 8s.ee 72.00 28.00 93.00 75.00 82.00 73.40 68.88 85.00 49.00 63.00 Class average: 70.94 Process exited after e.06594 seconds with return value e Press any key to continue .
V/arrays of structure
#include <iostream>
using namespace std;
const int SIZE=5;
6
struct Student{
string firstName;
string lastName;
double score;
char schoolYear;
8
9
11
};
12
13
14 9 int main(){
15
16
//struct definition
17
//declare array of this new data type
struct Student students[SIZE];
18
19
20
//take input of 5 students into this array
cout <« "Enter info for 5 students: ";
for (int i=0;i<SIZE;i++)
21
22
23
24
cin >:
students[i].firstName>>students[i].lastName>»students[i].score>>students[i].schoolYear;
25
//display the output of this array of structure
for (int i-@;i<SIZE;i++)
cout « students[i].firstName<<"\t"<<students[i].lastName<<"\t"<«students[i].score<<"\t"<«students[i].schoolYear<<endl;
26
27
28
29
}
30
Transcribed Image Text:V/arrays of structure #include <iostream> using namespace std; const int SIZE=5; 6 struct Student{ string firstName; string lastName; double score; char schoolYear; 8 9 11 }; 12 13 14 9 int main(){ 15 16 //struct definition 17 //declare array of this new data type struct Student students[SIZE]; 18 19 20 //take input of 5 students into this array cout <« "Enter info for 5 students: "; for (int i=0;i<SIZE;i++) 21 22 23 24 cin >: students[i].firstName>>students[i].lastName>»students[i].score>>students[i].schoolYear; 25 //display the output of this array of structure for (int i-@;i<SIZE;i++) cout « students[i].firstName<<"\t"<<students[i].lastName<<"\t"<«students[i].score<<"\t"<«students[i].schoolYear<<endl; 26 27 28 29 } 30
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Template
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