CIT052 Index > awk Exercise 2

awk Exercise 2

  1. Do lab 4 on page 202 of the book. You will put each answer into a file as a separate awk command. Name the file lastname_firstname_logic.awk. (Download lab4.data.)

    Note: Please change the questions to read as follows:

    3. Print the names of those who contributed between $75 and $200 in the first month.

    5. Print the names and phone numbers of those with an average monthly contribution greater than $200.

    9. Add $10 to Chet’s second contribution and print the changed record.

    10. Change Nancy McNeil’s name to Louise McInnes and print the changed record.

  2. Do lab 5 on pages 226-227 of the book. Please name the file in the form lastname_firstname_contributions.awk. (Download lab5.data.)

    Your file must not be tied to this specific data. If the amounts change, or if new lines are added to the file, your script must still produce the correct results for that data. Hint: To find the minimum and maximum value, you have to give them an initial value. Since you can't predict the maximum or minimum in advance, you must add code to set the maximum and minimum to the first contribution if this is the first record.

When You Finish

Email both files to the instructor.