Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Gawk programming in Linux terminal *create a gawk script/file called minor1.gawk to create the grades.txt, just copy n paste the contents of a) into a

Gawk programming in Linux terminal

*create a gawk script/file called minor1.gawk

to create the grades.txt, just copy n paste the contents of a) into a text file

image text in transcribed

image text in transcribed

Using gawk a) Consider a file containing grade test grades for students called grades.txt file: Last, First, A/I, Test1, Test2, Test3 Smith, John, A, 90,100,99 Ballard, Sue, I, 15,,50 Clark, Sally, A, 100,50, Koen, Jack, I, 90,100,99 Ball, Lucy, A, 100,100,100 Bently, Mark, A, 100,,100 The file is comma delimited. The first line is a header. The records contain Last Name, First Name, Active/Inactive file and several test scores. Ignore the heading line. For each Active student calculate their average grade for each student printing out the Students First Name followed by Last Name and average score. Display a heading at the beginning with a name for the report and headings for the columns of Name and Average. After all students have been processed display the number of active students and the average class test score. Format the output so that only 1 digit after the decimal point is shown and the averages scores line up on the decimal points. In this file, for example, the gawk program should print the following: $ gawk -f minor1.gawk grades.txt Student Average Test Scores Name Average John Smith 96.3 Sally Clark 50.0 Lucy Ball 100.0 Mark Bently 66.7 4 Students with average score of 78.2 Using gawk a) Consider a file containing grade test grades for students called grades.txt file: Last, First, A/I, Test1, Test2, Test3 Smith, John, A, 90,100,99 Ballard, Sue, I, 15,,50 Clark, Sally, A, 100,50, Koen, Jack, I, 90,100,99 Ball, Lucy, A, 100,100,100 Bently, Mark, A, 100,,100 The file is comma delimited. The first line is a header. The records contain Last Name, First Name, Active/Inactive file and several test scores. Ignore the heading line. For each Active student calculate their average grade for each student printing out the Students First Name followed by Last Name and average score. Display a heading at the beginning with a name for the report and headings for the columns of Name and Average. After all students have been processed display the number of active students and the average class test score. Format the output so that only 1 digit after the decimal point is shown and the averages scores line up on the decimal points. In this file, for example, the gawk program should print the following: $ gawk -f minor1.gawk grades.txt Student Average Test Scores Name Average John Smith 96.3 Sally Clark 50.0 Lucy Ball 100.0 Mark Bently 66.7 4 Students with average score of 78.2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

1.what is the significance of Taxonomy ?

Answered: 1 week ago

Question

What are the advantages and disadvantages of leasing ?

Answered: 1 week ago

Question

Name is needed for identifying organisms ?

Answered: 1 week ago