Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with a UNIX/Linux awk scripting question please: Below are the student

ID: 3796630 • Letter: N

Question

Need help with a UNIX/Linux awk scripting question please:

Below are the student grades for each class component:

$ cat score

pchen 72 50 71 55 93 115

jmaszk 45 76 49 88 102

bvbui 59 78 53 96 145

mtcrowle 33 65 39 82 100

mrchave 3 54 77 56 98 158

Write an awk script called activity6.1-8.awk that compute the final percentage score for each student, as well as the class average

The max score is 450 and should be set in the BEGIN block The output should be (round the score to nearest integer):

Total number of records: 5
Final score for pchen72 = 85.33% Final score for jmaszk = 80%
...
Class Average = 86.1%

The header line should show: Final Score computation

Explanation / Answer

A)

awk '{ print $5 }' table1.txt > output1.txt
$ cat score
pchen 72 50 71 55 93 115
jmaszk 45 76 49 88 102
bvbui 59 78 53 96 145
mtcrowle 33 65 39 82 100
mrchave 3 54 77 56 98 158  
awk 'pchen=="$72" { print $1 }' table1.txt
awk 'jmaszk=="$45" { print $1 }' table1.txt