Week 15 — Introduction to Object-Oriented Programming
Welcome to your Week 15 Start Here page.
Why this matters
A health-science student whose app keeps a separate record for each clinic visit and a game designer giving each character its own position and energy both need many objects built from one blueprint.
In plain language
Your reading log keeps a goal and a page count, and a separate function works them out. This week you bundle the numbers and the work into one thing. A class (a blueprint that says what data each new thing holds and what it can do) lets you build as many objects (separate things made from that blueprint) as you need. Each object keeps its own numbers, so changing one never changes another. As always, you predict what each program prints and then run it to check.
- Already covered: functions and return from Week 7, lists and methods from Week 9, error types from Week 12.
- This week: classes and objects, the setup method, attributes on self, methods, and the missing-self bug.
- How they connect: a method is a function that lives inside a class.
- Where we're going next: Week 16, the cumulative final.
Focus
How do you bundle data and the functions that work on it into one thing?
By the end of this module, you should be able to:
- [ ] write a class with a setup method, attributes on self, and methods
- [ ] show that each instance keeps its own state
- [ ] find the missing-self bug
To-do
Plan your week
- Read Chapter 15 (about 45 minutes), then the lecture and slides.
- Work the lecture tutorial (60–90 minutes) and the practice set (about 20 minutes).
- Do the Coding Lab (about 90 minutes), the discussion, and the assignment.
- Take the quiz.
This week's checkpoint: build two objects from one class and predict each one's attributes before you run it.
You've got this
Predict, then run, and ask your instructor if a step snags.
Built with The Course Maker · samples.thecoursemaker.com