Project 4: Average Scores |
< Previous Next > |
Input file project4-inputA.txt: |
Output to the screen: | Output file "averages.csv" |
---|---|---|
Mary 76 89 82 100 Joey 91 81 83 95 Sally 92 93 90 97 |
Please enter the scores filename: project4-inputA.txt You entered project4-inputA.txt Opened scores file project4-inputA.txt Mary scores: 76.0 89.0 82.0 100.0 average: 86.75 Joey scores: 91.0 81.0 83.0 95.0 average: 87.5 Sally scores: 92.0 93.0 90.0 97.0 average: 93.0 |
# Student name, grade average Mary,86.75 Joey,87.5 Sally,93.0 |
Input file project4-inputB.txt: |
Output to the screen: | Output file "averages.csv" |
---|---|---|
Mary 76 89 82 100 Joey 91 81 83 95 Sally 92 93 90 97 Billy 86 88 91 67 Emma 98 79 95 89 Noah 85 92 96 90 |
Please enter the scores filename: project4-inputB.txt You entered project4-inputB.txt Opened scores file project4-inputB.txt Mary scores: 76.0 89.0 82.0 100.0 average: 86.75 Joey scores: 91.0 81.0 83.0 95.0 average: 87.5 Sally scores: 92.0 93.0 90.0 97.0 average: 93.0 Billy scores: 86.0 88.0 91.0 67.0 average: 83.0 Emma scores: 98.0 79.0 95.0 89.0 average: 90.25 Noah scores: 85.0 92.0 96.0 90.0 average: 90.75 |
# Student name, grade average Mary,86.75 Joey,87.5 Sally,93.0 Billy,83.0 Emma,90.25 Noah,90.75 |
Input file fileDoesNotExist.txt: |
Output to the screen: | Output file "averages.csv" |
---|---|---|
n/a |
Please enter the scores filename: fileDoesNotExist.txt You entered fileDoesNotExist.txt Could not open scores file, [Errno 2] No such file or directory: 'fileDoesNotExist.txt' |
n/a |
handin project4 project4.py rubric4.txtTo verify your submission, type the following in a terminal window:
handin project4
Points Item ---------- -------------------------------------------------------------- _____ / 18 Meaniful comments _____ / 20 Opens files correctly (and handles IO exceptions) _____ / 30 Processes the scores file correctly _____ / 20 Writes to "averages.csv" _____ / 10 Closes the files _____ / 2 Completed rubric (estimates for each line including hours spent) _____ /100 Total _____ Approximate number of hours spent
python3 project4.py < /nfshome/hcarroll/public_html/1170/private/projects/project4-stdinA.txtIf you want to match my output exactly, then run the following on ranger:
python3 project4.py < /nfshome/hcarroll/public_html/1170/private/projects/project4-stdinA.txt > outputA.txt diff /nfshome/hcarroll/public_html/1170/private/projects/project4-answerKeyA.txt outputA.txtIf the two files match exactly (which is what you want) then there should be NO output from diff. If diff shows one or more differences, fix them and run it again. To get side-by-side output (with the answer key on the left and your output on the right), replace the last line with:
diff --side-by-side /nfshome/hcarroll/public_html/1170/private/projects/project4-answerKeyA.txt outputA.txtFor details about interpreting the output of diff, see the Using diff section on the Misc. webpage.