Changes

Jump to: navigation, search

OPS435 Python Assignment 1 2018 Fall

554 bytes added, 12:21, 18 December 2018
Documentation
When making back up of data files or log files, it is a very common practice to name the backup directories and/or files based on the date the backup was done. In order to restore or locate the directory/file, we often need to find out the backup date from today's date.
The computation computational task for this assignment is to design an algorithm and write a python script according to you your algorithm with appropriate functions. The script will should take a date in the "YYYYMMDD" format and the number of day days before or after the given date as the command line arguments, calculate and output to the standard output data channel the requested targeted date which is the number of day before or after the given date in the same format.
== Coding Standard ==
Your python script must follow the following coding guide:
* [https://www.python.org/dev/peps/pep-0008/ PEP-8 -- Style Guide for writing Python Code]
== Command Line Argument to be supported ==
== Algorithm Design ==
* Write a step-by-step instructions in English on how to figure out a date which is n days before or after a given date.
* While you are working on the step-by-step instructions, note that there are different number of days in each month and some years hav have 365 days and some years have 366 days.
* You should also do some research to find out when we started using the Calendar in the current form. (This will pose a limit on the validity of your algorithm.)
 
== Required Modules and Functions ==
<b><font color='blue'>Your python script is allowed to import only the <u>os and sys </u> modules from the standard library and all the built-in modules.</font></b>
Based on your algorithm designed for this assignment, you should at least have the following three functions defined in your python script (see later section on the purpose of each function):
== Documentation ==
* Please use python's docstring to document your python script and each of the functions you created for this assignment. The docstring should describle 'what' the function does, not 'how' it does.
* The following shows the docstring that was added to the tomorrow() function which provides the following information when call called with help(tomorrow) in the python interactive shell:
<pre>
Help on function tomorrow in module rchan:
return next_date
</pre>
 
= Rubric =
 
{| class="wikitable" border="1"
! Task !! Maximum mark !! Actual mark
|-
| Program Authorship Declaration ||5 ||
|-
| Program usage || 5 ||
|-
| Program Options --step || 5 ||
|-
| tomorrow() function || 5 ||
|-
| yesterday() function || 15 ||
|-
| dbda() function || 10 ||
|-
| script level docsting || 5 ||
|-
| leapyear() function || 15 ||
|-
| validdate() function || 15 ||
|-
| usage() function || 5 ||
|-
| Algorithm ||15||
|-
|'''Total''' || 100 ||
 
|}
= Assignment Due Date and submission procedure =
This Assignment is due on Sunday October 14, 2018 before mid-night. Please submit your algorithm (step-by-step instruction for solving the computation problem for this assignment in the English language), your python script, required test and test results to blackboard under the assignments section. Please refer to the detail submission instruction given on Blackboard.
1,760
edits

Navigation menu