This site has the lecture notes for **CMPT 135 in Spring 2024 at SFU Surrey**. [Canvas](https://canvas.sfu.ca) is where you'll find course marks, due dates, assignment marking schemes, discussions, announcements, etc.
## Useful Links
CMPT 135 uses modern C++ in Linux/Unix, and you should try to set up Linux on your own computer:
- If you're using **Windows**, I recommend you follow these instructions: [[Using VS Code to Run C++]].
- If you have a **Mac**, you can use the Terminal that comes with it and install the necessary software for this course (`g++`, `make`, and `valgrind`) using a package manager such as [MacPorts](https://ports.macports.org/) or [Homebrew](https://brew.sh/). You could also try [installing a virtual machine on Mac](https://www.macworld.com/article/668848/best-virtual-machine-software-for-mac.html) that runs Ubuntu.
> Please make the effort to get C++ running on your own computer. It might take a bit of work the first time, but it's something that all software developers should be able to do.
If for some reason none of the choices above work for you, then you could:
- try [[Setting up a Linux a virtual machine]]
- use the computers in CSIL
- try running C++ on using a web-based environment [Github Codespaces](https://github.com/features/codespaces) or [repl.it](http://repl.it)
**Ncurses** is a library that gives you more control over the cursor on the screen, and it might be used in some examples or assignments. Here are some instructions for [[setting up ncurses on Ubuntu Linux]].
## Assignments
See Canvas for assignment due dates and submission.
- [Assignment 1](https://github.com/tjd1234/cmpt135spring2024/tree/main/assignments/a1)
- [Assignment 2](https://github.com/tjd1234/cmpt135spring2024/tree/main/assignments/a2)
- [Assignment 3](https://github.com/tjd1234/cmpt135spring2024/tree/main/assignments/a3)
- [Assignment 4](https://github.com/tjd1234/cmpt135spring2024/tree/main/assignments/a4)
- [Assignment 5](https://github.com/tjd1234/cmpt135spring2024/tree/main/assignments/a5)
## Lecture Notes
**The timing of each topic is approximate, and may change as we go**. [The example code used in the lectures is usually available here](https://github.com/tjd1234/cmpt135spring2024/tree/main/sample_code).
### Week 1
Lecture 1: Course overview and [[C++ Review]]
Lecture 2: [[C++ Review]]
Lecture 3: [[How function calls work]]
### Week 2
Lecture 4: [[Testing code]]
Lecture 5: [[Testing code]]
Lecture 6: [[Pointers and memory management]]
### Week 3
Lecture 7: [[Pointers and memory management]]
Lecture 8: [[Pointers and memory management]]
Lecture 9: [[Pointers and memory management]]
### Week 4
Lecture 10: [[Common Pointer Problems]]
Lecture 11: [[Object-oriented programming]]; example of [[function-oriented dynamic array]]
Lecture 12: [[Object-oriented programming]]
### Week 5
Lecture 13: [[Object-oriented programming]]
Lecture 14: [[Object-oriented programming]]
Lecture 15: [[Object-oriented programming]]
- [[Implementing a dynamic array with objects]]
- [[double_list_plus.cpp|A dynamic array with some C++-specific features]]
### Week 6
Lecture 16: [[Introduction to inheritance|Inheritance and polymorphism]]
Lecture 17: [[Introduction to inheritance|Inheritance and polymorphism]]
Lecture 18: [[Introduction to inheritance|Inheritance and polymorphism]]
--------------------------
### Week 7: Reading week (Feb 19 - 23)
no lectures or labs
--------------------------
### Week 8
Lecture 19: midterm review
**Midterm!**
Lecture 20: [[Separate compilation]], and [[splitting int_vec]] into a `.h` and `.cpp` file; [[namespaces|Namespaces]]
### Week 9
Lecture 21: [[Introduction to Exceptions|Exceptions]]
Lecture 22: [[Recursion]]
Lecture 23: [[Recursion]]
### Week 10
Lecture 24: [[Recursion]]; [[Tracing Recursive Functions]]
Lecture 25: [[Calculating large powers]]
Lecture 26: [[The max function]]
### Week 11
Lecture 27: [[linear search|Algorithms and linear search]]
Lecture 28: [[Basic sorting]]
### Week 12
Lecture 29: [[Basic sorting]]
Lecture 30: [[basic sorting#Binary Search|Binary search]]
*Good Friday* (no lectures or labs)
### Week 13
*Easter Monday* (no lectures or labs)
Lecture 31: [[O-notation]]
Lecture 32: [[Easy and Hard Problems]]
### Week 14
Lecture 33: [[Using Templates]]
Lecture 34: Not on final exam: [[Top 10 Undiscussed Features of C++]]
Lecture 35: final exam review