Open main menu

CDOT Wiki β

Changes

OPS435 Assignment 2 Summer

1,719 bytes added, 12:37, 19 July 2019
Overview
[[Category:OPS435-Python]][[Category:rchan]]
'''<font color="red">DRAFT</font>
=Assignment 2 - Usage Report=
'''Weight:''' 15% of the overall grade
'''Due Date:''' Please follow the four stages of submission schedule:
* Complete the algorithm by July 1719, 2019 on github,* Complete the coding from algorithm to Python script by July 2426, 2019 on github* Complete the testing and debugging by July 31August 2, 2019 on github, and* Submit your also submit the algorithmfile, test results and your the python script by August 2, 2019 on to blackboard.
'''Late Penalty:''' 20% per school day, and note that this assignment must be completed satisfactorily in order to pass the course even if you get zero mark for this assignment.
$ cat usage_data_file
rchan pts/9 10.40.91.236 Tue Feb 13 16:53:42 2018 - Tue Feb 13 16:57:02 2018 (00:03)
cwsmith pts/10 10.40.105.130 Web Wed Feb 14 23:09:12 2018 - Thu Feb 15 02:11:23 2018 (03:02)
rchan pts/2 10.40.91.236 Tue Feb 13 16:22:00 2018 - Tue Feb 13 16:45:00 2018 (00:23)
rchan pts/5 10.40.91.236 Tue Feb 15 16:22:00 2018 - Tue Feb 15 16:55:00 2018 (00:33)
=====================================
Week # Usage in Seconds
2018 07 7969 18899Total 7969 18899
</pre>
==============================
Month Usage in Seconds
2018 02 15803560Total 15803560
</pre>
======================================
Month Usage in Seconds
2018 02 7969 18899Total 7969 18899
</pre>
== Suggested Script Development workflow for this assignment ===== create your own user account and a <font color="blue">private</font> repository on github ===* Use any of your valid email address (Seneca or non-Seneca) to registered for a github account.* Create a private repository named "ops435-a2" for this assignment.* Populate your private repository with appropriate files. Please check out the sample repository [https://github.com/rayfreeping/ops435-a2 here] === Add collaborator to your ops435-a2 private repository ===* Add your professor's github account as one of the collaborators to your ops435-a2 private repository. This will allow your professor to pull the contents of your ops435-a2 repository and also to make or suggest changes and fixes to your algorithm and/or python script.* Send an email from your Seneca email address to inform your professor the name of your github account. Your professor need this information to link your github account to your Seneca ID.* Make sure that your professor accepted your invitation from github. === Algorithm design ===Follow the standard computation procedure: input - process - ouput to design your algorithm for this assignment.==== input ====* get data (command line arguments/options) from the user using your script* according to the arguments/options given at the command line, take appropriate processing action. ==== processing ====* based on the file(s) specified, read the contents of each file and use appropriate objects to store it* based on the command line arguments/options, process the data accordingly, which includes** data preprocessing (split a multi-day record into single day record)** record processing (preform required computation)==== output ====* output the required report based on the processed data==== identify and select appropriate python objects and Testing functions ====The following python functions (to be created, you may have more) are useful in handling the following sub-tasks:
* reads login records from files and filters out unwanted records
* convert login records into proper python object type so that it can be processed using as much built-in functions as possible
* create function which generates weekly usage reports by user and/or by remote host
* create function which generates monthly usage reports by user and/or by remote host
To help you with this assignment, [[OPS435 A1 Usage Report Template|here is a template]] you can use the ur_template.py in the sample ops435-a2 repository as a starting point in designing your own Python Usage Report script.
=== Python script coding and debugging ===
For each function, identify what type of objects should be passed to the function, and what type of objects should be returned to the caller.
 
Once you have finished coding a function, you should start a Python3 interactive shell, import your functions and manually call the function you want to test under interactive mode and verify its correctness.
=== Final Test===
Once you have all the individual function tested and that each is working properly, perform the final test with test data provided by your professor and verify that your script produces the correct results before submitting your python program on Blackboard.
== Sample login/logout records file and sample test run results==
* [https://scswill be posted to the sample repository github.senecac.on.cacom/~raymond.chanrayfreeping/ops435/-a2/ Sample test data files and sample test run results]
== Rubric ==
! Task !! Maximum mark !! Actual mark
|-
| Algorithm and program design||15 |||-| Program Authorship Declaration ||5 |||-| Program usage || 5 20 ||
|-
| Program usage and Options || 15 20 ||
|-
| Generate user name list || 10 ||
|}
== Bonus item 10% extra ==
* Create a function to capture that output of the 'last -Fiw' on the system your script is being executed and return the contents in the type of object as what you get from a regular login/logout record file.
* Call this function and use the objects it returned when the file name input at the command line is 'last'.
== Submission ==
* Stage 1: upload your algorithm file to your ops435-a2 repository in github by July 19, 2019* Stage 2: upload your python script for this assignment to your ops435-a2 repository in github by July 26, 2019* Stage 3: After fully testing tested and debugged your programpython script for this assignment, update your algorithm, submit your python script ur_[student_id].py , and your test results to your ops435-a2 repository in github by August 2, 2019. Also submit the algorithm file and program design report ur_[student_id].pdf in pdf format on Blackboard python script to blackboard by August 2, 2019.
1,760
edits