Question: AWK Programming (EXTRA CREDIT 10 points) Create an AWK program that uses the SPARCS-noQuotes.csv file that you created during your lab activity (or recreate it).

AWK Programming (EXTRA CREDIT 10 points)

Create an AWK program that uses the SPARCS-noQuotes.csv file that you created during your lab activity (or recreate it). Calculate the average Total Charge per stay and per day. Remember each record represents one hospital stay and the field Length of Stay (LOS) represents the numbr of days the patient stayed each visit.

You must submit the code you wrote as a text file so that I can run this code.

A screen shot of your execution and the output. Note for full credit this should be done using AWK.

Your program should print out the following two lines:

Total # Records Total LOS Total Charge Avg Cost per Stay Avg Cost per Day

3 6 700 233.33 116.67

**Please note above numbers are from the example below.

So for example if you have 3 patients:

Length of Stay Total Charge

2 200

3 300

1 200

The total charges for all patients would be (200+300+200) 700

Number of hospital stays =3

Total length of stay (2+3+1) = 6

Average cost per stay will be (700/3) = $233.33

Average cost per day will be (700/6) = $116.67

Can you Plz answer this question in Terminal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!