Changes

Jump to: navigation, search

OPS435 Python3 Assignment 2P

51 bytes added, 19:02, 11 November 2019
Programmer-defined object type: Date
[[Category:OPS435-Python]][[Category:rchan]]
= Overview =
You have successfully design designed an algorithm to compute the date which is '''n''' day before or after a given date. You have also successfully implement implemented your algorithm using the Python language by identify identifying the functions that are need needed to perform the computation.
In this assignment, you are going to re-implement the algorithm you have for assignment 1 using python class. You are going to create a new programmer-define object call called Date with the appropriate data attributes and function attributes to support the necessary manipulation of '''date ''' object needed to implement your algorithm for assignment 1.
Your python script must follow the following coding guide:
** __init__(self): Date object constructor
** __repr__(self): return date object as a string in "yyyy-mm-dd" format
** __str__(self): return date object as a string in "yyyy:/mm:/dd" format
* Supporting function:
** days_to_time(): convert an integer which is n days from epoch (Jan 1, 1970) to a corresponding date object.
| class block || 5 ||
|-
| __init__() method || 10 5 ||
|-
| __str__() method || 5 ||
|-
| yesterday() method || 10 ||
|-
| day_of_week() function || 5||
|-
| docstring ||15||
1,760
edits

Navigation menu