Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cs288 Intensive Programming in Linux

Similar presentations


Presentation on theme: "Cs288 Intensive Programming in Linux"— Presentation transcript:

1 Cs288 Intensive Programming in Linux
Instructor: C F Yurkoski Section web site: Class 5 (going to slowly?) 6-9-15

2 cfy

3 Quiz results Written section 18% Programming sections 10% Overall 14%
Lessons learn: leave yourself time to submit your code to Moodle Submit something, even partial credit is better than nothing. We need more electrical outlets in here. cfy

4 Homework results Homework 1 average grade 72% Homework 2 70%
cfy

5 revu cfy

6 sample output ./analysis customerA buys routers and switches customerF buys servers customerG buys routers afsconnect1-159 homework3 >: cfy

7 Homework 6 revu part 1: # homework 6 if [ $# -ne 2 ] then
echo Usage: $0 competitor1 competitor2 exit 1 fi wget -q $1 -O one wget -q $2 -O two 6-9-15

8 Homework revu cont cont:
cat one | cut -d"," -f 1 | while read customer do grep $customer two done | cut -d"," -f 1 | while read commoncust a=`grep $commoncust one | cut -d"," -f 2` b=`grep $commoncust two | cut -d"," -f 2` let total=a+b if [ $total -gt ] then echo -n "$commoncust buys " prod1=`grep $commoncust one |cut -d"," -f 3` prod2=`grep $commoncust two |cut -d"," -f 3` if [ $prod1 != $prod2 ] echo $prod1 and $prod2 else echo $prod1 fi done 6-9-15

9 Complete solution at: https://web.njit.edu/~yurkowsk/x/analysis
cfy

10 Homework for next week Generalize solution from last week’s homework so that instead of accepting two arguments it accepts an arbitrary number of them. Change the threshold for a potential sales lead from $100,000 to 1,000,000 USD. List the potential sales leads and the products they purchase. Example output: cfy

11 /analysis2 https://web. njit
/analysis The big spenders are customerA customerD customerG customerH. customerA buys: routers switches customerD buys: customerG buys: customerH buys: afsconnect1-133 ~ >: cfy

12 Project revu 6-9-15

13 In https://web.njit.edu/~yurkowsk/project1/ there are 4 files:
and names contains a list of names, one per line. id contains a list of semicolon separated tuples, one per line consisting of a name and  the literal "ID" followed by a numeric id.. hours  contains list of semicolon separated tuples, one per line consisting of a numeric id and a number indicating the number hours worked that week. rate  contains list of semicolon separated tuples, one per line consisting of a numeric id and an hourly rate for that id.  Assume the rate is USD per hour. Your goal is to write a script which calculates the compensation for the names in first file for the week and output the names followed by a tab followed by a dollar sign followed by that name’s pay. Output one name and pay amount per line.  The output should be in alphabetical order by name regardless of the order in the “names” file. Write the results to standard out, output  any error messages to standard error. Your script should accept 5 command line arguments.   The first will be the name of a directory like the one above,  the next 4  are assumed be file names in that directory whose contents are formatted as the four URLs above and are in the same order as above.

14 https://web.njit.edu/~yurkowsk/x/projectone
cfy

15 cfy

16 cfy

17 cfy

18 Test1 part 1 written Closed book
30 minutes, tests will not be accepted late. For question 6 assume the file input contains the same contents as in question 1. cfy

19 Test part 2, problems on moodle.
cfy


Download ppt "Cs288 Intensive Programming in Linux"

Similar presentations


Ads by Google