Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 2 pages
Class notes

CSC108 Worksheet Days

Document preview thumbnail
Preview 1 out of 2 pages

CSC108 Worksheet Days

Content preview

CSC108H Fall 2022 Worksheet: Object-Oriented Programming – Class Day


For each method, implement the body.

import event

class Day:
"""A calendar day and its events."""

def __init__(self, day: int, month: str, year: int) -> None:
"""Initialize a day on the calendar with day, month and year,
and no events.

>>> d = Day(7, 'December', 2022)
>>> d.day
7
>>> d.month
'December'
>>> d.year
2022
>>> d.events
[]
"""




def schedule_event(self, new_event: 'Event') -> None:
"""Schedule new_event on this day, even if it overlaps with
an existing event. Later we will improve this method.

>>> d = Day(7, 'December', 2022)
>>> e = event.Event(11, 12, 'Meeting')
>>> d.schedule_event(e)
>>> d.events[0] == e
True
"""

Document information

Uploaded on
December 14, 2022
Number of pages
2
Written in
2022/2023
Type
Class notes
Professor(s)
N/a
Contains
12
CA$12.10

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
2
Followers
1
Items
25
Last sold
3 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions