Scope: Lectures 1, 3, 4, 5, 6, 7, 8, 9, 10 (except 2) Chapters 6, 7, 8, 10 in the book programming assignments 1, 2, 3, 4 Lecture 1: intro to OOP - Object and class - The sequence to define and use a class in a program - How/when to use scope resolution operator - How/when to the dot operator - Should be able to write the prototype and implementation of a simple class Lecture 2: Not in the exam Lecture 3: Protection levels and constructors - What are the protection levels in C++? Why these levels? - When can one access public members, when can one access private members? - What is the constructor of a class? - When is the constructor executed? - What is a default constructor? - How to invoke non-default constructor? Lecture 4: friend, conversion constructor, destructor - How to declare a friend function? - What can a friend function do? - What is the difference between a friend function and a normal function? - Is a friend function public or private? - friend function .vs. member function - What is a conversion constructor, when is it called? - How to disable the implicit invocation of a conversion constructor? - What is a destructor? When it is called? Lecture 5: The const keyword understand each of the const used in the following program. Class abc { public: abc(); void show() const; // const 1 void what(); private: void print(const abc & x); // const 2 int c; const int d; // const 3 }; void abc:: show() const { } void abc::abc() : c(0), d(10) {} main() { const int I = 10; // const 4 const abc xx; xx.show(); xx.what(); } - What does the term calling object refer to? - What is a const member function? - What is a const object? - What is const member data? - the use of initialization list. Lecture 6: Operator overloading - What effect does operator overloading achieve? - Two methods to overload operators +, -, *, /, ==, !=, >, >=, <, <= + as a member function + as a friend function (need to be able to write code for this) - Overloading >> and << operator - Expressions with operator form and function form: a+b == operator+(a, b), a+b = a.operator+(b); - limitations of operator overloading - Need to able to be write code for operator overloading Lecture 7: Composition - Be able to code with objects within objects - The order of constructor invocation for objects within objects - the use of initialization list - The use of the dot operator for object within object Lecture 8: Array of objects - be able to use and declare array of objects: how to access each object element? how to access the public members of an object element Lecture 9: Pointers - Relationship between variable value, variable address, pointers and reference - pointer assignment, deference - What is the type of ptr in 'int ***ptr;' - What is wrong when returning a pointer to a local variable? - pointer arithmetic - array form and pointer form for access array elements A[100] == *(A+100) Lecture 10: Overloading/Dynamic memory allocation - Operator overloading with different types. - Under what situation should we use this allocation mechanism. - How to allocate/delete an item and an array of items? - the '->' operator: M1_ptr->simplify() == (*M1_ptr).simplify(); - Correct use of new/delete ================================================================ Concept and short questions/coding questions 60%-70% (from book and lecture notes) programming questions 30%-40% (one question for each project)