Problem 1 (Analyzing Student Database) The student_info.txt file (available on cuLearn) contains information for many randomly-generated students. The student information follows the structure given below: Student1_first_name Student1_last_name Student1_serial_number Student1_assignment_grade Student1_midterm_grade Student1_exam_grade Student2_first_name Student2_last_name Student2_serial_number Student2_assignment_grade Student2_midterm_grade Student2_exam_grade Download the student_info.txt and t6_p1.py files and put it in the same directory. If you accidentally introduce an error into the data file (i.e., break the structure some how), you can redownload it to get a fresh copy. Add the following functions to t6_p1.py file. Write and test a function called store_results(in_filename, out_filename) that takes two string input parameters for input filename and output filename. You function should read each student’s information from the in_filename (text file) and writes the following information in the given pattern to out_filename (another text file). Student1_serial_number Student1_first_name,Student1_last_name (separated by a comma) Student1_total_grade Student2_serial_number Student2_first_name,Student2_last_name (separated by a comma) Student2_total_grade ... where total_grade is computed using the following weight distribution: assignments=25%, midterm=25%, and exam=50% of the total grade. This function does not return any value. Write a function named highest_total(out_filename) that takes the name of a text file with the format generated by the previous function. This function computes the highest total grade of all students grades, and returns the name and the grade of the student with the highest total grade. Run the main function to verify the output. those are the student info text file; Francis Young 1 64 70 63 Heather Suen 2 93 78 80 Antonio Givens 3 75 78 80 Mario Small 4 71 73 62 Esperanza Walters 5 71 78 80 Jessica Long 6 79 81 67 Kristin Reddish 7 51 62 57 Martha Potts 8 75 64 74 Douglas Tanner 9 70 70 64 Kerry Mcdonald 10 51 61 48 Heidi Ross 11 76 76 84 Charles Flores 12 59 58 45 Steven Sumner 13 62 72 67 Bennie Mcdonald 14 68 72 82 Janice Wallace 15 57 56 70 Ronald Zimmerman 16 80 84 73 Agustin Diederich 17 54 50 52 Jane Sullivan 18 30 49 42 Cecilia Stanbaugh 19 93 75 83 Harriet Tirk 20 56 37 41 Mary Briones 21 61 50 48 Fannie Thomas 22 92 84 88 April Schreimann 23 76 81 75 Clara Grigsby 24 34 46 38 Scott Watson 25 78 79 71 Teresa Gonzalez 26 80 73 66 Robert Knecht 27 59 61 76 Lillian Reynolds 28 72 73 69 Joseph Perez 29 53 50 55 Robert Gugino 30 69 63 66 Mark Mcardell 31 81 79 88 Winfred Payne 32 78 84 88 Alice Jones 33 90 83 90 Cleo Bradley 34 55 51 49 Lorraine Smith 35 67 55 69 Christopher Schmitt 36 50 60 49 Son Evans 37 59 62 49 Geraldine Berry 38 53 54 47 Mary Carson 39 87 75 81 Caroline Ross 40 49 42 40 James Byrnes 41 87 94 91 Kelly Murray 42 47 59 49 Dale Bowman 43 88 71 81 Todd Fleming 44 82 72 68 Sarah Rohm 45 68 59 68 Lillian Moy 46 81 63 81 Ethel Young 47 76 77 67 Grady Wilson 48 59 71 60 Marlon Peabody 49 53 49 53 Inge Phillips 50 59 60 56 Son Morison 51 56 67 66 Ronald Ressler 52 63 56 46 Edith Aldridge 53 54 67 59 Michelle Garcia 54 65 66 80 Christiane Brewer 55 93 81 89 Regina Ruiz 56 81 66 69 Mark Dean 57 53 60 51 Guadalupe Jarrett 58 31 41 49 Shirley Edwards 59 74 74 90 Shirley Milton 60 45 52 45 Wendell Clark 61 72 60 70 Roberta Mcneil 62 83 87 77 Ethel Tshudy 63 60 51 50 Hae Norrod 64 69 82 69 Robert Johnson 65 98 85 80 Chris Durgin 66 76 72 63 Joshua Tew 67 70 59 59 John Soper 68 80 95 97 Margaret Batarse 69 75 86 75 Josefina Charlot 70 51 45 38 Glenda Boltz 71 48 42 52 Irene Pryor 72 56 50 46 Thomas Sanders 73 70 81 83 Melba Scull 74 61 67 61 Arlene Parrish 75 44 45 32 John Brown 76 71 86 85 Andrew Hanley 77 40 54 35 Timothy Jones 78 36 38 50 Antonio Collins 79 67 67 73 Patrick Johnson 80 53 62 55 Kari Liles 81 76 77 71 Nicholas Lemons 82 60 61 58 Jerry Lewis 83 40 44 38 Ross Cogswell 84 84 88 83 Jennie Brinkley 85 95 85 84 Monica Davis 86 74 66 58 Helen Auzenne 87 84 74 76 Tony Carrillo 88 62 67 63 Elisabeth Thompson 89 82 96 87 Lynn Longerbeam 90 43 50 51 Linda Felipe 91 50 46 41 Jacob Lange 92 44 35 35 Nancy Hannaford 93 54 55 69 Larry Mikulak 94 98 80 83 Georgianna Sakoda 95 45 51 49 Susan Moistner 96 83 79 80 Jennifer Grindle 97 63 63 60 Andrew Dickson 98 99 94 86 John Conley 99 53 49 51 Lesley Scruggs 100 66 49 54
Problem 1 (Analyzing Student
The student_info.txt file (available on cuLearn) contains information for many randomly-generated students. The student information follows the structure given below:
Download the student_info.txt and t6_p1.py files and put it in the same directory. If you accidentally introduce an error into the data file (i.e., break the structure some how), you can redownload it to get a fresh copy.
Add the following functions to t6_p1.py file.
-
Write and test a function called store_results(in_filename, out_filename) that takes two string input parameters for input filename and output filename. You function should read each student’s information from the in_filename (text file) and writes the following information in the given pattern to out_filename (another text file).
Student1_serial_number Student1_first_name,Student1_last_name (separated by a comma) Student1_total_grade
Student2_serial_number Student2_first_name,Student2_last_name (separated by a comma) Student2_total_grade
...where total_grade is computed using the following weight distribution: assignments=25%, midterm=25%, and exam=50% of the total grade.
This function does not return any value.
-
Write a function named highest_total(out_filename) that takes the name of a text file with the format generated by the previous function. This function computes the highest total grade of all students grades, and returns the name and the grade of the student with the highest total grade.
-
Run the main function to verify the output.
Young
1
64
70
63
Heather
Suen
2
93
78
80
Antonio
Givens
3
75
78
80
Mario
Small
4
71
73
62
Esperanza
Walters
5
71
78
80
Jessica
Long
6
79
81
67
Kristin
Reddish
7
51
62
57
Martha
Potts
8
75
64
74
Douglas
Tanner
9
70
70
64
Kerry
Mcdonald
10
51
61
48
Heidi
Ross
11
76
76
84
Charles
Flores
12
59
58
45
Steven
Sumner
13
62
72
67
Bennie
Mcdonald
14
68
72
82
Janice
Wallace
15
57
56
70
Ronald
Zimmerman
16
80
84
73
Agustin
Diederich
17
54
50
52
Jane
Sullivan
18
30
49
42
Cecilia
Stanbaugh
19
93
75
83
Harriet
Tirk
20
56
37
41
Mary
Briones
21
61
50
48
Fannie
Thomas
22
92
84
88
April
Schreimann
23
76
81
75
Clara
Grigsby
24
34
46
38
Scott
Watson
25
78
79
71
Teresa
Gonzalez
26
80
73
66
Robert
Knecht
27
59
61
76
Lillian
Reynolds
28
72
73
69
Joseph
Perez
29
53
50
55
Robert
Gugino
30
69
63
66
Mark
Mcardell
31
81
79
88
Winfred
Payne
32
78
84
88
Alice
Jones
33
90
83
90
Cleo
Bradley
34
55
51
49
Lorraine
Smith
35
67
55
69
Christopher
Schmitt
36
50
60
49
Son
Evans
37
59
62
49
Geraldine
Berry
38
53
54
47
Mary
Carson
39
87
75
81
Caroline
Ross
40
49
42
40
James
Byrnes
41
87
94
91
Kelly
Murray
42
47
59
49
Dale
Bowman
43
88
71
81
Todd
Fleming
44
82
72
68
Sarah
Rohm
45
68
59
68
Lillian
Moy
46
81
63
81
Ethel
Young
47
76
77
67
Grady
Wilson
48
59
71
60
Marlon
Peabody
49
53
49
53
Inge
Phillips
50
59
60
56
Son
Morison
51
56
67
66
Ronald
Ressler
52
63
56
46
Edith
Aldridge
53
54
67
59
Michelle
Garcia
54
65
66
80
Christiane
Brewer
55
93
81
89
Regina
Ruiz
56
81
66
69
Mark
Dean
57
53
60
51
Guadalupe
Jarrett
58
31
41
49
Shirley
Edwards
59
74
74
90
Shirley
Milton
60
45
52
45
Wendell
Clark
61
72
60
70
Roberta
Mcneil
62
83
87
77
Ethel
Tshudy
63
60
51
50
Hae
Norrod
64
69
82
69
Robert
Johnson
65
98
85
80
Chris
Durgin
66
76
72
63
Joshua
Tew
67
70
59
59
John
Soper
68
80
95
97
Margaret
Batarse
69
75
86
75
Josefina
Charlot
70
51
45
38
Glenda
Boltz
71
48
42
52
Irene
Pryor
72
56
50
46
Thomas
Sanders
73
70
81
83
Melba
Scull
74
61
67
61
Arlene
Parrish
75
44
45
32
John
Brown
76
71
86
85
Andrew
Hanley
77
40
54
35
Timothy
Jones
78
36
38
50
Antonio
Collins
79
67
67
73
Patrick
Johnson
80
53
62
55
Kari
Liles
81
76
77
71
Nicholas
Lemons
82
60
61
58
Jerry
Lewis
83
40
44
38
Ross
Cogswell
84
84
88
83
Jennie
Brinkley
85
95
85
84
Monica
Davis
86
74
66
58
Helen
Auzenne
87
84
74
76
Tony
Carrillo
88
62
67
63
Elisabeth
Thompson
89
82
96
87
Lynn
Longerbeam
90
43
50
51
Linda
Felipe
91
50
46
41
Jacob
Lange
92
44
35
35
Nancy
Hannaford
93
54
55
69
Larry
Mikulak
94
98
80
83
Georgianna
Sakoda
95
45
51
49
Susan
Moistner
96
83
79
80
Jennifer
Grindle
97
63
63
60
Andrew
Dickson
98
99
94
86
John
Conley
99
53
49
51
Lesley
Scruggs
100
66
49
54
Step by step
Solved in 3 steps with 3 images