Question
Examine the file students.txt that you downloaded at the start of the lab. Each row of this file contains a students first name, last name,
Examine the file students.txt that you downloaded at the start of the lab. Each row of this file contains a students first name, last name, major, and 5 test scores. Write a script that uses a while read statement to input all of the data, line by line, compute the average test score and then assign a letter grade (see the logic on page 15 of the text). The 5th test is worth double (you should divide by 6 instead of 5 since test 5 is worth twice as much). Output for each student, the students last name, major and letter grade. Additionally, sum up the number of students who passed (got at least a D or higher) and the number of students who failed. When you run your script, remember to redirect input from students.txt.
Here is the student.txt
Tommy Mars CIT 90 80 70 89 76 Ruth Underwood CIT 95 96 94 88 91 Jeff Beck ENG 76 40 60 53 56 George Duke MUS 100 90 100 92 95 Thana Harris CSC 80 89 82 86 95 Frank Zappa CSC 51 36 63 58 90 Steve Hackett MUS 65 64 80 75 82 Suzie Creamcheese MIN 80 79 66 54 83 Phideaux Xavier CIT 57 51 63 86 69 Valerie Gracious MUS 85 86 75 76 91 Steve Howe CIT 90 80 70 70 60Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started