Answered step by step
Verified Expert Solution
Question
1 Approved Answer
AWK Programming AWK Programming Save the following data in a file named teamlist.txt: Name,Team,First Test, Second Test, Third Test Tom.Red,5,17,22 Joe,Green,3,14,22 Maria,Blue,6,18,21 Fred,Blue,2,15,23 Carlos,Red,-1,15,24 Phuong,Green,7,19,21
AWK Programming
AWK Programming Save the following data in a file named teamlist.txt: Name,Team,First Test, Second Test, Third Test Tom.Red,5,17,22 Joe,Green,3,14,22 Maria,Blue,6,18,21 Fred,Blue,2,15,23 Carlos,Red,-1,15,24 Phuong,Green,7,19,21 Enrique,Green,3,16,20 Nancy,Red,9,12,24 Write an AWK script that will compute the average score for every person in the list, the average score for each test, and the average score for each team. If a score is negative, that means the person missed the test, and the score must not become part of the average Print the output to look like the following. In the list by name, the names must be left justified in a field of size 10 (hint: %-10s in print), and the averages must be seven characters wide with two digits to the right of the decimal point (%7.21) Name Average 14.67 13.00 Tom Joe Maria 15.00 Fred Carlos 19.50 Phuong 15.67 Enrique 13.00 Nancy 15.00 13.33 Average for Test 1: 5 Average for Test 2: 15.75 Average for Test 3: 22.125 Average for Red Team: 16 Average for Green Team: 13.8889 Average for Blue Team: 14.1667Step 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