Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 0 7 ( 4 0 points ) Write an awk script that will take the following input file and display: The total number of

Task 07(40 points)
Write an awk script that will take the following input file and display:
The total number of votes (add all votes).
The average number of votes (add all votes and divide by the number of breeds).
The breeds with more than the average number of votes (highest to lowest).
The breeds with less than the average number of votes (lowest to highest).
Check the example output carefully, we expect your output to match it EXACTLY.
\table[[Input file (lab_d_06.csv),Example output],[Breed, Votes,Total votes: 111],[Black Lab, 30,Average votes: 15.86],[Chihuahua,2,],[Pug,1,Most popular:],[Corgi,45,Corgi],[Shar Pei, 21,Black Lab],[Shih Tzu, 5,Shar Pei],[Maltese,7,],[,Least popular:],[,Pug],[,Chihuahua],[,Shih Tzu],[,Maltese]]
Note: Your output value for average votes can be an integer or a floating point number with a precision of one or two decimal places to the right.Task 06(10 points)
Write an awk script that will take the following input file and output the least popular dog breed based on the number of votes. Check the example output carefully, we expect your output to match it EXACTLY.
\table[[Input file (lab_d_06.csv),Example output],[Breed, Votes,The Pug is sad because it only got 1],[Black Lab, 30,vote(s).],[Chihuahua,2,],[Pug,1,],[Corgi,45,],[Shar Pei, 21,],[Shih Tzu, 5,],[Maltese,7,]]
image text in transcribed

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions