Notes for CMPT 135 Spring 2020¶
The course marking scheme, assignments, quizzes, due dates, etc. are on Canvas.
Assignments¶
Late assignments will be handled using “late time” as described on Canvas.
The weekly coding challenges are on Canvas.
Exam Info¶
- Midterm exam info
- Final exam info Cancelled!
- As directed by SFU, all in-person exams have been cancelled, and so the final exam for this course has been removed.
See the course handbook for information about how final grades are calculated.
Software¶
makefile, cmpt_error.h, and cmpt_trace.h
These files are used in all our programs. Download copies to your computer and put them in every folder where you write a C++ program.
Setting up Ubuntu using VMware on a Windows machine. VirtualBox is another good (and totally free) choice for running virtual machines.
Fish is the shell program I use in class, and I prefer it over the default shell (which is usually Bash).
Sublime Text 3 is the editor I use in class. I also use the TabNine plugin for intelligent completions.
practical examples of many Linux commands; for basic tasks, often more useful than the
man
command
Lecture Notes¶
Notes and relevant links will be posted here as the course progresses.
The official assignment and exam due dates are on Canvas. Any dates listed here are only for convenience, and if they are not the same as on Canvas then you should assume the Canvas due dates are correct.
The textbook for this course is Problem Solving with C++ (9th edition), by Walter Savitch.
Week 1: Jan 6 to Jan 10
- Monday Jan 6 is the first day of lectures
- you should get Ubuntu Linux and g++ set up a virtual machine on your computer; Here are some instructions for using VMware; VirtualBox is another good (and totally free) choice for running virtual machines.
- check out the some basic command-line commands, and examples of how to compile C++ programs using make
- review of basic C/C++ coding; please read through any earlier chapters of the textbook if you need to brush-up on basic C++
Week 2: Jan 13 to Jan 17
- review of basic C/C++ coding; please read through any earlier chapters of the textbook if you need to brush-up on basic C++
- notes on Unit Testing
Week 3: Jan 20 to Jan 24
Week 4: Jan 27 to Jan 31
- please read sections 10.1 to 10.4 of the textbook (defining classes)
- Example of basic structs
- A point class: point_class1_cpp;
point_class2_cpp (destructor,
this
, declarations) - A class implementation of a dynamic array: part 1, part 2, part 3
Week 5: Feb 3 to Feb 7
- A class implementation of a dynamic array: part 1, part 2, part 3
Final int_vec.cpp classs developed in the lectures
Week 6: Feb 10 to Feb 14
- please read sections 15.1 to 15.3 of the textbook (skip
protected
) - Inheriting from a vector
- notes on inheritance and polymorphism, and some notes on designing with classes
The midterm exam covers everything before this point.
Feb 17 to Feb 21: Reading break (no lectures or labs)
Week 7: Feb 24 to Feb 28
Week 8: Mar 2 to Mar 6
- please read section 12.1 to 12.2 (separate compilation and namespaces) of the textbook (you can skip the details about ADTs for now)
- here is an overview of the process for making the
RGB_color
class separately compilable: separately compiling RGB_color- here is one more similar example, this time splitting int_vec into .h and .cpp files
- you don’t need to know the details of how to use makefiles for multiple compilation: just know that makefiles are designed for running all the commands and options needed by separate compilation
- namespaces
- please read chapter 16 (exception handling) of the textbook
- notes on exceptions
Week 9: Mar 9 to Mar 13
- please read chapter 14 (recursion) of the textbook
- notes on recursion
- Case study: maze flood fill
Week 10: Mar 16 to Mar 20
- All SFU courses moved online!
- calculating large powers
- the max function
Week 11: Mar 23 to Mar 27
Week 12: Mar 30 to Apr 3
Week 13: Apr 6 to Apr 10
- hard problems
- Wednesday Apr 8 is the last lecture
- Thursday Apr 9 is the last day of classes for the spring semester
Exam schedule: Apr 14 to Apr 25
- 135 final exam: CANCELLED due to move to online (was Monday Apr 20, 8:30am to 11:30am)