Menu

[Solved]Write Shell Script Invoking Awk Produce Grade Report Class Script Named Gradereport Invoke Q37281538

Write a shell script invoking awk to produce a grade report for a class. The script should be named grade_report and will beA:89.5 B: 79.5 C: 69.5 D: 59.5 F:0 The Report: Using the grades and weights defined above we would get the following data tes

Write a shell script invoking awk to produce a grade report for a class. The script should be named grade_report and will be invoked by grade_report [grade_file] [project_file] [level_file] If any file names are omitted, please use “grades”, “projects” and “levels” as defaults In other words if one file name is given, it is the grade file. If two file names are given, the first is the grade file and the second is the project file The Grades File: The grades file will contain one line per student with the student’s name and grades separated by colons. An example grades file is :60 John Bunyan:90:100:75 Maria Montessori:80:90:60:82 Alice Cooper:75:80:54:47 Harvey Mudd: 89:45:89:95 The Project File: The project file should contain 1 line for each project assigned with the project’s name and weight separated by colons. An example project file is test1:30 test2:30 paper: 20 exam: 50 You will note that the weights are relative and need not add up to 100. In this case the total of the weights is 130 The Levels File: The levels file determines how letter grades are assigned. The file contains the letter grade and minimum average required for each possible grade. You are permitted to assume that only the letter grades in the example below are possible A:89.5 B: 79.5 C: 69.5 D: 59.5 F:0 The Report: Using the grades and weights defined above we would get the following data test1*30 test2*30 paper 20 exam*50 total total/130 Name 2700 2400 2250 2670 3000 2700 2400 1350 1500 1200 1080 1780 John Bunyan Maria Montessori Alice Cooper Harvey Mudd 3000 10200 78.4615 4100 10400 80 2350 8080 62.1538 4750 10550 81.1538 Based on the calculations above and the given minimums for grade levels, we would produce a report sorted in decreasing average order like the one below Grade Report Name test1 test2 paper exam average grade 89 45 8995 81.2 B 90 100 75 60 78.5 C Harvey Mudd Maria Montessori 80 90 60 82 80 John Bunyan Alice Cooper 75 80 54 47 62.2 D Error Checking: Since error checking is generally hard, you will be required to do only a few error checks. Al l other possible errors may be ignored Check to make sure all three files are actually files and are readable. Make sure that there are exactly 2 fields in each record of the project file. Make sure that there are exactly 2 fields in each record of the levels file. Make sure that each record of the grade file has the correct number of fields (one more than the number of projects) Show transcribed image text Write a shell script invoking awk to produce a grade report for a class. The script should be named grade_report and will be invoked by grade_report [grade_file] [project_file] [level_file] If any file names are omitted, please use “grades”, “projects” and “levels” as defaults In other words if one file name is given, it is the grade file. If two file names are given, the first is the grade file and the second is the project file The Grades File: The grades file will contain one line per student with the student’s name and grades separated by colons. An example grades file is :60 John Bunyan:90:100:75 Maria Montessori:80:90:60:82 Alice Cooper:75:80:54:47 Harvey Mudd: 89:45:89:95 The Project File: The project file should contain 1 line for each project assigned with the project’s name and weight separated by colons. An example project file is test1:30 test2:30 paper: 20 exam: 50 You will note that the weights are relative and need not add up to 100. In this case the total of the weights is 130 The Levels File: The levels file determines how letter grades are assigned. The file contains the letter grade and minimum average required for each possible grade. You are permitted to assume that only the letter grades in the example below are possible
A:89.5 B: 79.5 C: 69.5 D: 59.5 F:0 The Report: Using the grades and weights defined above we would get the following data test1*30 test2*30 paper 20 exam*50 total total/130 Name 2700 2400 2250 2670 3000 2700 2400 1350 1500 1200 1080 1780 John Bunyan Maria Montessori Alice Cooper Harvey Mudd 3000 10200 78.4615 4100 10400 80 2350 8080 62.1538 4750 10550 81.1538 Based on the calculations above and the given minimums for grade levels, we would produce a report sorted in decreasing average order like the one below Grade Report Name test1 test2 paper exam average grade 89 45 8995 81.2 B 90 100 75 60 78.5 C Harvey Mudd Maria Montessori 80 90 60 82 80 John Bunyan Alice Cooper 75 80 54 47 62.2 D Error Checking: Since error checking is generally hard, you will be required to do only a few error checks. Al l other possible errors may be ignored Check to make sure all three files are actually files and are readable. Make sure that there are exactly 2 fields in each record of the project file. Make sure that there are exactly 2 fields in each record of the levels file. Make sure that each record of the grade file has the correct number of fields (one more than the number of projects)

Expert Answer


Answer to Write a shell script invoking awk to produce a grade report for a class. The script should be named grade_report and wil… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *