100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Class notes

CSC108 Worksheet Days

Rating
-
Sold
-
Pages
2
Uploaded on
14-12-2022
Written in
2022/2023

CSC108 Worksheet Days









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

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

Subjects

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
"""
CA$12.15
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
yudasu

Get to know the seller

Seller avatar
yudasu University of Toronto
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
3 year
Number of followers
1
Documents
25
Last sold
3 year ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

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

Frequently asked questions