**[CSCI 135 ANALYSIS & DESIGN 1 HUNTER COLLEGE CITY UNIVERSITY OF NEW YORK](2023_spring.html)**
In these two courses, both of which are required to graduate with a computer science major, you will learn principles of programming, analysis, and design and gain a deep practical knowledge of C++.
[**CSCI 135 Syllabus**](syllabus_135.html){:target="_blank"} [**Gradescope**](https://www.gradescope.com/courses/502287){:target="_blank"} [**Coding Style Guide**](worked_examples/style_guide.html){:target="_blank"}
**Text:** EITHER: [*Cay Horstmann*, **Brief C++**, 3rd ed. eText](https://www.vitalsource.com/products/brief-c-late-objects-enhanced-etext-cay-s-horstmann-v9781119400424?term=978-1-119-40042-4){:target="_blank"} – rent the eText for one semester only from here – DO NOT buy or rent it from Amazon or Kindle store – you will not get access to the necessary interactive material!
OR: PDF (or hard copy) of **Brief C++**, 3rd ed. or **Big C++**, 2nd ed.
**Linux on Windows NEW Video Tutorial:** [http://tiny.cc/2p0jvz](https://www.dropbox.com/scl/fi/na5wupu9pyaarxoxjh55x/WSL-Setup.mp4?rlkey=bylnzs4uybv8l1zd9m4z8g6au&dl=0){:target="_blank"}
**COURSE OUTLINE**
DATE | TOPIC | READING: | SLIDES | DUE DATES
:---: | :---: | --- | :---: | ---:
1/25 | [Syllabus](syllabus_135.html){:target="_blank"}
[Gradescope](https://www.gradescope.com/courses/33735){:target="_blank"}
**C++ Review** | [1.6 Errors](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/40[;vnd.vst.idref=bc3e_ch01-10]!/4[bc3e_ch01-10]/2/2[_idParaDest-17]/2@0:0){:target="_blank"}
[1.7 HW Algorithm Design](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/44[;vnd.vst.idref=bc3e_ch01-12]!/4[bc3e_ch01-12]/2/2[_idParaDest-20]/2@0:0){:target="_blank"}
[2.4 **PS** First Do It By Hand](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/102[;vnd.vst.idref=bc3e_ch02-16]!/4[bc3e_ch02-16]/2/2[_idParaDest-82]/2@0:0){:target="_blank"} 2/6 | [1.6](slides/1.6 Errors.pdf){:target="_blank"} | **[LAB 1 Intro to Linux and to C++](labs/lab_01.html){:target="_blank"} 2/2**
[E3.5](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/188[;vnd.vst.idref=bc3e_ch03-21]!/4[bc3e_ch03-21]/4/2[_idParaDest-154]/2@0:0 "Write a program that reads three numbers and prints 'increasing' if they are in increasing order, 'decreasing' if they are in decreasing order, and 'neither' otherwise. Here, 'increasing' means 'strictly increasing', with each value larger than its predecessor. The sequence 3 4 4 would not be considered increasing."){:target="_blank"} 2/28
2/13 | **Functions** | [5.1 Functions as Black Boxes](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/276[;vnd.vst.idref=bc3e_ch05-1]!/4[bc3e_ch05-1]/4/2[_idParaDest-213]/2@0:0){:target="_blank"}
[5.2 Implementing Functions](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/278[;vnd.vst.idref=bc3e_ch05-2]!/4[bc3e_ch05-2]/2/2[_idParaDest-214]/2@0:0){:target="_blank"}
[5.3 Parameter Passing](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/282[;vnd.vst.idref=bc3e_ch05-4]!/4[bc3e_ch05-4]/2/2[_idParaDest-218]/2@0:0){:target="_blank"}
[5.4 Return Values](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/286[;vnd.vst.idref=bc3e_ch05-6]!/4[bc3e_ch05-6]/2/2[_idParaDest-221]/2@0:0){:target="_blank"}
[5.5 Functions without Return Values](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/296[;vnd.vst.idref=bc3e_ch05-11]!/4[bc3e_ch05-11]/4/2[_idParaDest-232]/2@0:0){:target="_blank"}
[5.6 **PS** *Reusable Functions*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/298[;vnd.vst.idref=bc3e_ch05-12]!/4[bc3e_ch05-12]/2/2[_idParaDest-233]/2@0:0){:target="_blank"}
[5.7 **PS** *Stepwise Refinement*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/300[;vnd.vst.idref=bc3e_ch05-13]!/4[bc3e_ch05-13]/4/2[_idParaDest-234]/2@0:0){:target="_blank"}
[5.8 Variable Scope and Global Variables](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/306[;vnd.vst.idref=bc3e_ch05-16]!/4[bc3e_ch05-16]/4/2[_idParaDest-243]/2@0:0){:target="_blank"} | [5.1-3](slides/5.1 Functions as Black Boxes _ 5.2 Implementing Functions _ 5.3 Parameter Passing.pdf){:target="_blank"}
[Viz](https://is.gd/PBgUWm){:target="_blank"}
[Pyramid](https://onlinegdb.com/SyM889WUV){:target="_blank"}
[5.4-6](slides/5.4 Return Values _ 5.5 Functions without Return Values _ 5.6 Reusable Functions.pdf){:target="_blank"}
[5.7](slides/5.7 Stepwise Refinement.pdf){:target="_blank"}
[5.8](slides/5.8 Variable Scope and Globals.pdf){:target="_blank"} | **[LAB 5 Functions and
Prime Numbers](labs/lab_05.html){:target="_blank"} 3/8**
[WE 5.1](worked_examples/ch5_WE1.pdf){:target="_blank"}
[E5.6](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/332[;vnd.vst.idref=bc3e_ch05-25]!/4[bc3e_ch05-25]/4/38/2@0.00:0 "Write a function string middle(string str) that returns a string containing the middle character in str if the length of str is odd, or the two middle characters if the length is even. For example, middle('middle') returns 'dd'."){:target="_blank"} 2/22
[WE 5.2](worked_examples/ch5_WE2.pdf){:target="_blank"}
[WE 5.3](worked_examples/ch5_WE3.pdf){:target="_blank"}
**[LAB 7 Auto Style](labs/lab_07.html){:target="_blank"} 3/3**
3/22 | **Classes** | [9.1 Object-Oriented Programming](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/558[;vnd.vst.idref=bc3e_ch09-1]!/4[bc3e_ch09-1]/4/2[_idParaDest-420]/2@0:0){:target="_blank"}
[9.2 Implementing a Simple Class](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/560[;vnd.vst.idref=bc3e_ch09-2]!/4[bc3e_ch09-2]/2/2[_idParaDest-421]/2@0:0){:target="_blank"}
[9.3 Specifying the Public Interface](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/562[;vnd.vst.idref=bc3e_ch09-3]!/4[bc3e_ch09-3]/2/2[_idParaDest-422]/2@0:0){:target="_blank"}
[9.4 Designing the Data Representation](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/566[;vnd.vst.idref=bc3e_ch09-5]!/4[bc3e_ch09-5]/2/2[_idParaDest-426]/2@0:0){:target="_blank"}
[9.5 Member Functions](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/568[;vnd.vst.idref=bc3e_ch09-6]!/4[bc3e_ch09-6]/2/2[_idParaDest-427]/2@0:0){:target="_blank"} | [9.1-2](slides/9.1-2 Object Oriented Programming _ Implementing a Simple Class.pdf){:target="_blank"}
[Code](https://is.gd/R4d6lP){:target="_blank"}
[9.3-5](slides/9.3-5 Specifying the Public Interface _ Designing the Data Representation _ Member Functions.pdf){:target="_blank"}
[Code](https://is.gd/t2DNWg){:target="_blank"} | [WE 9.1](worked_examples/ch9_WE1.pdf){:target="_blank"}
**[LAB 10 Classes, Enums](labs/lab_10.html){:target="_blank"} 4/28**
[E9.3](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/624[;vnd.vst.idref=bc3e_ch09-31]!/4[bc3e_ch09-31]/4/16/2@0.00:0 "Simulate a circuit for controlling a hallway light that has switches at both ends of the hallway. Each switch can be up or down, and the light can be on or off. Toggling either switch turns the lamp on or off. Provide member functions: int get_first_switch_state() /*0 for down, 1 for up*/; int get_second_switch_state(); int get_lamp_state() /*0 for off, 1 for on*/; void toggle_first_switch(); void toggle_second_switch()"){:target="_blank"} _ / __
**[LAB 11 More Classes](labs/lab_11.html){:target="_blank"} _ / __**
2/16 | **Pass by
Reference** | [12.5 Reference Parameters](https://www.learncpp.com/cpp-tutorial/pass-by-lvalue-reference/){:target="_blank"}
[12.6 Const Refferences](https://www.learncpp.com/cpp-tutorial/pass-by-const-lvalue-reference/){:target="_blank"} | [5.9](slides/5.9 Reference Parameters.pdf){:target="_blank"}
[Coffee](https://is.gd/d7Rb0b){:target="_blank"}
[Code](https://is.gd/0Phq6B){:target="_blank"}
[By Value](https://is.gd/vlyTPE){:target="_blank"}
[By Ref.](https://is.gd/Rb3H9r){:target="_blank"} | **[E5.14](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/332[;vnd.vst.idref=bc3e_ch05-25]!/4[bc3e_ch05-25]/4/100/2@0.00:0 "Write a function void sort2(int& a, int& b) that swaps the values of a and b, if a is greater than b and otherwise leaves a and b unchanged. For example: int u = 2; int v = 3; int w = 4; int x = 1; sort2(u, v); //u is still 2, v is still 3// sort2(w, x); //w is now 1, x is now 4//"){:target="_blank"} 2/22**
**[E5.15](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/332[;vnd.vst.idref=bc3e_ch05-25]!/4[bc3e_ch05-25]/4/114/2@0.00:0 "Write a function sort3(int& a, int& b, int& c) that swaps its three arguments to arrange them in sorted order. For example: int v = 3; int w = 4; int x = 1; sort3(v, w, x); //v is now 1, w is now 3, x is now 4// Hint: Use multiple calls to the sort2 function of Exercise E5.14."){:target="_blank"} 2/22**
3/1 | **Pointers**
***LEARN CPP CH 12.7-9*** | [7.1 Defining and Using Pointers](https://bookshelf.vitalsource.com/#/books/9781119400424/cfi/6/368!/4/4/2/2@0.00:0){:target="_blank"}
[Pointers Example](https://is.gd/EACOYN){:target="_blank"} | [7.1](slides/7.1 Defining and Using Pointers.pdf){:target="_blank"}
[Ptrs](slides/MyPointers.pdf){:target="_blank"} | [E7.1](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/498[;vnd.vst.idref=bc3e_ch07-33]!/4[bc3e_ch07-33]/4/4/2@0.00:0 "Write a function void sort2(double* p, double* q) that receives two pointers and sorts the values to which they point. If you call sort2(&x, &y) then x <= y after the call."){:target="_blank"} _ /__
**[Project 1 C & D](projects/S23_project_1/project_1_cs135.html){:target="_blank"} _ /__**
2/21 | **Arrays**
***LEARN CPP CH 16.1,6-9*** | [6.1 Arrays](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/338[;vnd.vst.idref=bc3e_ch06-1]!/4[bc3e_ch06-1]/4/2[_idParaDest-260]/2@0:0){:target="_blank"}
[6.2 Common Array Algorithms](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/348[;vnd.vst.idref=bc3e_ch06-6]!/4[bc3e_ch06-6]/2/2[_idParaDest-270]/2@0:0){:target="_blank"}
[0's, ](https://is.gd/O5f1Li){:target="_blank"}[Squares, ](http://is.gd/8EVEht){:target="_blank"}[Copy, ](http://is.gd/COL3Qf){:target="_blank"}[Sum, Avg, ](https://is.gd/MOQCog){:target="_blank"}[Min, Max, ](https://is.gd/r1eoU4){:target="_blank"}[Search, ](https://is.gd/PnZHCf){:target="_blank"}[Remove unordered](https://is.gd/YIpjoK){:target="_blank"} | [6.1](slides/6.1 Arrays.pdf){:target="_blank"}
[6.2](slides/6.2 Common Array Algorithms.pdf){:target="_blank"} | [*Binary Search*](https://youtu.be/p7k9ncsB5Cs){:target="_blank"}
3/2 | | [7.2 Arrays and Pointers](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/440[;vnd.vst.idref=bc3e_ch07-5]!/4[bc3e_ch07-5]/2/2[_idParaDest-335]/2@0:0){:target="_blank"}
[Code](https://onlinegdb.com/ryXWGIsFr){:target="_blank"} | [7.2](slides/7.2 Arrays and Pointers.pdf){:target="_blank"} |
3/9 | **Dynamic Memory**
***LEARN CPP CH 19.1,2*** | [7.4 Dynamic Memory Allocation](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/460[;vnd.vst.idref=bc3e_ch07-15]!/4[bc3e_ch07-15]/4/2[_idParaDest-355]/2@0:0){:target="_blank"} [Viz](https://goo.gl/gxgRm6){:target="_blank"} | [7.4](slides/7.4 Dynamic Memory Allocation.pdf){:target="_blank"} |
3/13 | | [7.6 PS Draw a Picture](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/466[;vnd.vst.idref=bc3e_ch07-18]!/4[bc3e_ch07-18]/2/2[_idParaDest-362]/2@0:32.6){:target="_blank"} | [Viz](https://is.gd/enLJHs){:target="_blank"} | **[PS 7.6 (1 and 3 only)](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/466[;vnd.vst.idref=bc3e_ch07-18]!/4[bc3e_ch07-18]/2/2[_idParaDest-362]/2@0:32.6){:target="_blank"}**
[WE 7.1](worked_examples/ch7_WE1.pdf){:target="_blank"}
3/15 | | | | **[LAB 8 Image Processing](labs/lab_08.html){:target="_blank"} _ / __**
**[E7.16](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/498[;vnd.vst.idref=bc3e_ch07-33]!/4[bc3e_ch07-33]/4/68@0:94.3 "Define a structure Point. A point has an x- and a y-coordinate. Write a function double distance(Point a, Point b) that computes the distance from a to b. Write a program that reads the coordinates of the points, calls your function, and displays the result."){:target="_blank"} 3/21**
3/16 | | | | **[LAB 9 Pointers](labs/lab_09.html){:target="_blank"} 3/21**
**[E8.1](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/552[;vnd.vst.idref=bc3e_ch08-22]!/4[bc3e_ch08-22]/4/2[_idParaDest-417]/2@0:0 "Write a program that carries out the following tasks: Open a file with the name hello.txt. Store the message “Hello, World!” in the file. Close the file. Open the same file again. Read the message into a string variable and print it."){:target="_blank"} _ / __**
3/20 | **Objects &
Pointers** | [7.7](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/474[;vnd.vst.idref=bc3e_ch07-22]!/4[bc3e_ch07-22]/2/2[_idParaDest-368]/2@0:0){:target="_blank"} & [7.8 Pointers and Objects](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/486[;vnd.vst.idref=bc3e_ch07-28]!/4[bc3e_ch07-28]/2/2[_idParaDest-376]/2@0:0){:target="_blank"} | [7.7-8](slides/7.7-8 Classes of Objects _ Pointers and Objects.pdf){:target="_blank"}
[Viz](https://is.gd/EUQqdJ){:target="_blank"} | **[E7.18](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/498[;vnd.vst.idref=bc3e_ch07-33]!/4[bc3e_ch07-33]/4/68@0:94.3 "Define a structure Triangle that contains three Point members. Write a function that computes the `perimeter()` of a Triangle. Write a program that reads the coordinates of the points, calls your function, and displays the result."){:target="_blank"} 3/21**
2/22 | | [Remove ordered, ](https://is.gd/NXYUSi){:target="_blank"}[Insert unordered, ](https://is.gd/fY2jKt){:target="_blank"}[Insert ordered, ](https://is.gd/HFYphC){:target="_blank"}[Read inputs and find largest, ](https://onlinegdb.com/rJ3V9sNYB){:target="_blank"}
[6.3 Arrays and Functions](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/372[;vnd.vst.idref=bc3e_ch06-18]!/4[bc3e_ch06-18]/2/2[_idParaDest-288]/2@0:0){:target="_blank"}
[Array functions](https://onlinegdb.com/ByXteh4KS){:target="_blank"} | [6.3](slides/6.3 Arrays and Functions.pdf){:target="_blank"} | **[E6.8](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/426[;vnd.vst.idref=bc3e_ch06-39]!/4[bc3e_ch06-39]/4/60/2@0.00:0 "Write a function: bool equals(int a[], int a_size, int b[], int b_size) that checks whether two arrays have the same elements in the same order."){:target="_blank"} 4/5**
**[Project 1 A and B](projects/S23_project_1/project_1_cs135.html){:target="_blank"} 3/1**
[*Selection Sort*](https://youtu.be/xWBP4lzkoyM){:target="_blank"}
2/23 | | [6.4 PS: *Adapting Algorithms*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/376[;vnd.vst.idref=bc3e_ch06-20]!/4[bc3e_ch06-20]/2/2[_idParaDest-291]/2@0:0){:target="_blank"} | [6.4-5](slides/6.4 PS Adapting Algorithms _ 6.5 Discovering Algorithms.pdf){:target="_blank"} | [PS 6.4](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/376[;vnd.vst.idref=bc3e_ch06-20]!/4[bc3e_ch06-20]/2/2[_idParaDest-291]/2@0:0){:target="_blank"}
[WE 6.1](worked_examples/ch6_WE1.pdf){:target="_blank"}
[WE 6.2](worked_examples/ch6_WE2.pdf){:target="_blank"}
2/27 | | [6.5 PS: *Discovering Algorithms by Manipulating Physical Objects*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/382[;vnd.vst.idref=bc3e_ch06-23]!/4[bc3e_ch06-23]/4/2[_idParaDest-296]/2@0:0){:target="_blank"}
[6.6 Two-Dimensional Arrays](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/384[;vnd.vst.idref=bc3e_ch06-24]!/4[bc3e_ch06-24]/2/2[_idParaDest-297]/2@0:0){:target="_blank"}
[Print 2D array](https://onlinegdb.com/Sych9yBKr){:target="_blank"} | [6.6](slides/6.6 2D Arrays.pdf){:target="_blank"} | [PS 6.5](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/382[;vnd.vst.idref=bc3e_ch06-23]!/4[bc3e_ch06-23]/4/2[_idParaDest-296]/2@0:0){:target="_blank"}
**[LAB 6 Strings and Ciphers](labs/lab_06.html){:target="_blank"}**
**[E8.1](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/552[;vnd.vst.idref=bc3e_ch08-22]!/4[bc3e_ch08-22]/4/2[_idParaDest-417]/2@0:0 "Write a program that carries out the following tasks: Open a file with the name hello.txt. Store the message “Hello, World!” in the file. Close the file. Open the same file again. Read the message into a string variable and print it."){:target="_blank"} 3/21**
3/27 | | [9.9 Separate Compilation](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/592[;vnd.vst.idref=bc3e_ch09-18]!/4[bc3e_ch09-18]/2/2[_idParaDest-454]/2@0:0){:target="_blank"} | [9.9](slides/9.9 Separate Compilation.pdf){:target="_blank"} | **[E9.5](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/624[;vnd.vst.idref=bc3e_ch09-31]!/4[bc3e_ch09-31]/4/36/2@0.00:0 "Implement a class Rectangle. Provide a constructor to construct a rectangle with a given width and height, member functions float get_perimeter() and float get_area() that compute the perimeter and area, and a member function void resize(double factor) that resizes the rectangle by multiplying the width and height by the given float factor."){:target="_blank"} _ / __**
**[Project 2 A & B](projects/S23_project_2/project_2_cs135.html){:target="_blank"} _ /__**
3/30 | | [9.6 Constructors](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/576[;vnd.vst.idref=bc3e_ch09-10]!/4[bc3e_ch09-10]/2/2[_idParaDest-436]/2@0:0){:target="_blank"} | [9.6](slides/9.6 Constructors.pdf){:target="_blank"} |
4/19 | **Inheritance**
***LEARN CPP CH 24*** | [10.1 Inheritance Hierarchies](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/630%5B%3Bvnd.vst.idref%3Dbc3e_ch10-1%5D!/4%5Bbc3e_ch10-1%5D/4/2%5B_idParaDest-472%5D/2%400:0){:target="_blank"}
[10.2 Implementing Derived Classes](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/632%5B%3Bvnd.vst.idref%3Dbc3e_ch10-2%5D!/4%5Bbc3e_ch10-2%5D/2/2%5B_idParaDest-473%5D/2%400:0){:target="_blank"} | [10.1](slides/10.1 Inheritance Hierarchies.pdf){:target="_blank"}
[10.2](slides/10.2 Implementing Derived Classes.pdf){:target="_blank"} | [WE 10.1](worked_examples/ch10_WE1.pdf){:target="_blank"}
4/20 | | [10.3 Overriding Member Functions](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/636%5B%3Bvnd.vst.idref%3Dbc3e_ch10-4%5D!/4%5Bbc3e_ch10-4%5D/4/2%5B_idParaDest-484%5D/2%400:0){:target="_blank"}
[10.4 Virtual Functions and Polymorphism](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/640%5B%3Bvnd.vst.idref%3Dbc3e_ch10-6%5D!/4%5Bbc3e_ch10-6%5D/2/2%5B_idParaDest-487%5D/2%400:0){:target="_blank"} | [10.3](slides/10.3 Overriding Member Functions.pdf){:target="_blank"}
[10.4](slides/10.4 Virtual Functions and Polymorphism.pdf){:target="_blank"} | [10 Extra](slides/10 Extra.pdf){:target="_blank"}
4/27 | **Recursion**
***LEARN CPP CH 20.3*** | [5.10 Recursive Functions](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/314[;vnd.vst.idref=bc3e_ch05-20]!/4[bc3e_ch05-20]/2/2[_idParaDest-251]/2@0:0){:target="_blank"} | [5.10](slides/5.10 Recursive Functions.pdf){:target="_blank"}
[Print Triangle](https://is.gd/wEoL1J){:target="_blank"} | **[E5.21](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/332[;vnd.vst.idref=bc3e_ch05-25]!/4[bc3e_ch05-25]/4/162/16@0:100 "Write a recursive function string reverse(string str) that computes the reverse of a string. For example, reverse('flow') should return 'wolf'. Hint: Reverse the substring starting at the second character, then add the first character at the end. For example, to reverse 'flow', first reverse 'low' to 'wol', then add the 'f' at the end."){:target="_blank"} 5/1**
[WE 5.1](worked_examples/ch5_WE1.pdf){:target="_blank"}
[WE 5.3](worked_examples/ch5_WE3.pdf){:target="_blank"}
5/1 | **More Recursion** | **[Project 3 ](https://maryash.github.io/135/projects/S23_project_3/project_3_cs135.html){:target="_blank"}** | [Add Digits](https://is.gd/w1O0X6){:target="_blank"} | **[Project 3 ](https://maryash.github.io/135/projects/S23_project_3/project_3_cs135.html){:target="_blank"} 5/10**
| | | |
2/14 | **More Loops** | [**4.6 PS** *Storyboards*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/216[;vnd.vst.idref=bc3e_ch04-12]!/4[bc3e_ch04-12]/2/2[_idParaDest-187]/2@0:0){:target="_blank"}
[4.7 Common Loop Algorithms](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/218[;vnd.vst.idref=bc3e_ch04-13]!/4[bc3e_ch04-13]/2/2[_idParaDest-188]/2@0:0){:target="_blank"} | [4.6-8](slides/4.6 PS Storyboards _ 4.7 Common Loop Algorithms _ 4.8 Nested Loops.pdf){:target="_blank"}
| [WE 4.1](worked_examples/ch4_WE1.pdf){:target="_blank"}
[WE 4.2](worked_examples/ch4_WE2.pdf){:target="_blank"}
2/15 | | [4.8 Nested Loops](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/234[;vnd.vst.idref=bc3e_ch04-21]!/4[bc3e_ch04-21]/4/2[_idParaDest-199]/2@0:0){:target="_blank"}
[**4.9 PS** *Solve a Simple Problem First*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/238[;vnd.vst.idref=bc3e_ch04-23]!/4[bc3e_ch04-23]/4/2[_idParaDest-202]/2@0:0){:target="_blank"}
[4.10 Random Numbers and Simulations](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/240[;vnd.vst.idref=bc3e_ch04-24]!/4[bc3e_ch04-24]/4/2[_idParaDest-203]/2@0:0){:target="_blank"}
[3.7 Boolean Variables and Operators](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/168[;vnd.vst.idref=bc3e_ch03-15]!/4[bc3e_ch03-15]/2/2[_idParaDest-141]/2@0:0){:target="_blank"} | [4.9-10](slides/4.9 PS Solve a Simpler Problem First _ 4.10 Random Numbers and Simulations.pdf){:target="_blank"}
[Squares](https://onlinegdb.com/Sy9sJw3mL){:target="_blank"}
[Montecarlo](https://onlinegdb.com/rkbl2V3QI){:target="_blank"}
[3.7](slides/3.7 Boolean Variables and Operators.pdf){:target="_blank"} | **[LAB 4 Printing Shapes](labs/lab_04.html){:target="_blank"} 2/28**
[**PS 4.6**](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/216[;vnd.vst.idref=bc3e_ch04-12]!/4[bc3e_ch04-12]/2/2[_idParaDest-187]/2@0:0){:target="_blank"}
[**PS 4.9**](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/238[;vnd.vst.idref=bc3e_ch04-23]!/4[bc3e_ch04-23]/4/2[_idParaDest-202]/2@0:0){:target="_blank"}
1/26 | **C++ Quiz**
**Fundamental Data Types** | [2.1 Variables](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/70[;vnd.vst.idref=bc3e_ch02-1]!/4[bc3e_ch02-1]/4/2[_idParaDest-34]/2@0:0){:target="_blank"} | [2.1](slides/2.1 Variables.pdf){:target="_blank"} | [WE 2.1](worked_examples/ch2_WE1.pdf){:target="_blank"}
[WE 2.2](worked_examples/ch2_WE2.pdf){:target="_blank"}
**[E2.10](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/134[;vnd.vst.idref=bc3e_ch02-27]!/4[bc3e_ch02-27]/4/46/2@0:0 "E2.10 Write a program that asks the user to input: the number of gallons of gas in the tank, the fuel efficiency in miles per gallon, and the price of gas per gallon. Then print the cost per 100 miles and how far the car can go with the gas in the tank."){:target="_blank"} 2/6**
1/30 | **Strings** | [2.5 Strings](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/110[;vnd.vst.idref=bc3e_ch02-20]!/4[bc3e_ch02-20]/4/2[_idParaDest-89]/2@0:0){:target="_blank"} | [2.5](slides/2.5 Strings.pdf){:target="_blank"} |
2/1 | | [2.3 Input and Output](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/98[;vnd.vst.idref=bc3e_ch02-14]!/4[bc3e_ch02-14]/4/2[_idParaDest-78]/2@0:0){:target="_blank"} | [2.3-4](slides/2.3 Input and Output _ 2.4 PS First Do It By Hand.pdf){:target="_blank"} | **[LAB 2 Loops and Arrays](labs/lab_02.html){:target="_blank"} 2/10**
2/6 | **Decisions** | [3.1 The `if` Statement](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/140[;vnd.vst.idref=bc3e_ch03-1]!/4[bc3e_ch03-1]/4/2[_idParaDest-100]/2@0:0){:target="_blank"}
[3.2 Comparing Numbers and Strings](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/144[;vnd.vst.idref=bc3e_ch03-3]!/4[bc3e_ch03-3]/4/2[_idParaDest-114]/2@0:0){:target="_blank"}
[3.3 Multiple Alternatives](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/154[;vnd.vst.idref=bc3e_ch03-8]!/4[bc3e_ch03-8]/4/2[_idParaDest-129]/2@0:0){:target="_blank"}
[3.4 Nested Branches](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/158[;vnd.vst.idref=bc3e_ch03-10]!/4[bc3e_ch03-10]/2/2[_idParaDest-132]/2@0:0){:target="_blank"}
[3.8 Application: Input Validation](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/172[;vnd.vst.idref=bc3e_ch03-17]!/4[bc3e_ch03-17]/2/2[_idParaDest-150]/2@0:0){:target="_blank"} | [3.1](slides/3.1 The IF Statement.pdf){:target="_blank"}
[3.2](slides/3.2 Comparing Numbers and Strings.pdf){:target="_blank"}
[3.3-4](slides/3.3 Multiple Alternatives _ 3.4 Nested Branches.pdf){:target="_blank"}
[D.M.L.](https://onlinegdb.com/SkleVcbLN){:target="_blank"}
[3.8](slides/3.8 Application_ Input Validation.pdf){:target="_blank"} | **[E3.1](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/188[;vnd.vst.idref=bc3e_ch03-21]!/4[bc3e_ch03-21]/4/2[_idParaDest-154]/2@0:0 "Write a program that reads an integer and prints whether it is negative, zero, or positive."){:target="_blank"} 2/6**
[WE 3.1](worked_examples/ch3_WE1.pdf){:target="_blank"}
**[PS 3.5](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/162[;vnd.vst.idref=bc3e_ch03-12]!/4[bc3e_ch03-12]/4/2[_idParaDest-137]/2@0:0){:target="_blank"}**
**[PS 3.6](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/164[;vnd.vst.idref=bc3e_ch03-13]!/4[bc3e_ch03-13]/2/2[_idParaDest-138]/2@0:0){:target="_blank"}**
2/8 | **Loops** | [4.1 The `while` Loop](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/194[;vnd.vst.idref=bc3e_ch04-1]!/4[bc3e_ch04-1]/4/2[_idParaDest-157]/2@0:0){:target="_blank"}
[**4.2 PS** *Hand-Tracing*](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/200[;vnd.vst.idref=bc3e_ch04-4]!/4[bc3e_ch04-4]/4/2[_idParaDest-166]/2@0:0){:target="_blank"} | [4.1](slides/4.1 The WHILE Loop.pdf){:target="_blank"} | **[LAB 3 File I/O, Process Data](labs/lab_03.html){:target="_blank"} 2/21**
**[PS 4.2](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/200[;vnd.vst.idref=bc3e_ch04-4]!/4[bc3e_ch04-4]/4/2[_idParaDest-166]/2@0:0){:target="_blank"}**
**[E4.8](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/270[;vnd.vst.idref=bc3e_ch04-30]!/4[bc3e_ch04-30]/4/94@0:92.7 "Write a program that reads a word and prints each character of the word on a separate line. For example, if the user provides the input "Harry", the program prints: H a r r y"){:target="_blank"} 2/16**
2/9 | | [4.3 The `for` Loop](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/202[;vnd.vst.idref=bc3e_ch04-5]!/4[bc3e_ch04-5]/4/2[_idParaDest-167]/2@0:0){:target="_blank"}
[4.4 The `do` Loop](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/206[;vnd.vst.idref=bc3e_ch04-7]!/4[bc3e_ch04-7]/4/2[_idParaDest-175]/2@0:0){:target="_blank"}
[4.5 Processing Input](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/210[;vnd.vst.idref=bc3e_ch04-9]!/4[bc3e_ch04-9]/2/2[_idParaDest-178]/2@0:0){:target="_blank"} | [4.2-3](slides/4.2 PS Hand-Tracing _ 4.3 The FOR Loop.pdf){:target="_blank"}
[4.4-5](slides/4.4 The DO Loop _ 4.5 Processing Input.pdf){:target="_blank"} | [WE 8.1](worked_examples/ch8_WE1.pdf){:target="_blank"}
x/xx | |
[**\–/** Static Variables](https://www.learncpp.com/cpp-tutorial/43-static-duration-variables/){:target="_blank"}
[StatVar](slides/Static Variables.pdf){:target="_blank"}
[Run Code](https://is.gd/9gSmIR){:target="_blank"} | |
3/6 | **Review** | [5.9 Reference Parameters](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/310[;vnd.vst.idref=bc3e_ch05-18]!/4[bc3e_ch05-18]/2/2[_idParaDest-246]/2@0:0){:target="_blank"} | [Ptrs](slides/MyPointers.pdf){:target="_blank"}
[5.9_Slides](slides/5.9 Reference Parameters.pdf){:target="_blank"} |
3/15 | | [7.5 Arrays of Pointers](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/464[;vnd.vst.idref=bc3e_ch07-17]!/4[bc3e_ch07-17]/2/2[_idParaDest-361]/2@0:0){:target="_blank"} | [7.5-6](slides/7.5-6 Arrays of Pointers _ PS Draw a Picture.pdf){:target="_blank"} | **[LAB 8 Image Processing](labs/lab_08.html){:target="_blank"} _ / __**
**[E7.16](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/498[;vnd.vst.idref=bc3e_ch07-33]!/4[bc3e_ch07-33]/4/68@0:94.3 "Define a structure Point. A point has an x- and a y-coordinate. Write a function double distance(Point a, Point b) that computes the distance from a to b. Write a program that reads the coordinates of the points, calls your function, and displays the result."){:target="_blank"} 3/21**
3/16 | | [Galton Board](https://www.youtube.com/watch?v=3m4bxse2JEQ){:target="_blank"} | [Viz](https://is.gd/00MNC7){:target="_blank"} | **[LAB 9 Pointers](labs/lab_09.html){:target="_blank"} 3/21**
**[E8.1](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/552[;vnd.vst.idref=bc3e_ch08-22]!/4[bc3e_ch08-22]/4/2[_idParaDest-417]/2@0:0 "Write a program that carries out the following tasks: Open a file with the name hello.txt. Store the message “Hello, World!” in the file. Close the file. Open the same file again. Read the message into a string variable and print it."){:target="_blank"} _ / __**
**3/8** | **MIDTERM EXAM 1** | **WEDNESDAY 3/8** | |
4/3 | **Enumerations** | [The `switch` Statement](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/156[;vnd.vst.idref=bc3e_ch03-9]!/4[bc3e_ch03-9]/2/2@0.00:0){:target="_blank"}
Enumerated types: [bool](https://onlinegdb.com/SyunJ1Rn7){:target="_blank"}, [switch](https://onlinegdb.com/SkBzlk02X){:target="_blank"}, [MyBool](https://onlinegdb.com/SkKBlJ02X){:target="_blank"}, [LIKELY](https://onlinegdb.com/rJoKx1Ah7){:target="_blank"}, [Color](https://onlinegdb.com/SJf6e1AnQ){:target="_blank"}, [Colors](https://onlinegdb.com/BkSWbyR37){:target="_blank"} | [Enums](slides/Enums.pdf){:target="_blank"} | [**PS 5.7**](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/300[;vnd.vst.idref=bc3e_ch05-13]!/4[bc3e_ch05-13]/4/2[_idParaDest-234]/2@0:0){:target="_blank"}
4/17 | **Streams** | [8.1 Reading and Writing Text Files](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/502[;vnd.vst.idref=bc3e_ch08]!/4[bc3e_ch08]/4[_idContainer1160]/2/2@0:0){:target="_blank"} | [8.1](slides/8.1 Reading and Writing Text Files.pdf){:target="_blank"} |
4/24 | **Vectors** | [6.7 Vectors](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/398[;vnd.vst.idref=bc3e_ch06-31]!/4[bc3e_ch06-31]/4/2[_idParaDest-308]/2@0:0){:target="_blank"} | [6.7](slides/6.7 Vectors.pdf){:target="_blank"} | **[E6.18](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/426[;vnd.vst.idref=bc3e_ch06-39]!/4[bc3e_ch06-39]/4/194/2@0.00:0 "Write a function vector append(vector a, vector b) that appends one vector after another. For example, if a is 1 4 9 16 and b is 9 7 4 9 11 then append returns the vector 1 4 9 16 9 7 4 9 11"){:target="_blank"} [E6.20](https://bookshelf.vitalsource.com/#/books/9781119400424/epubcfi/6/426[;vnd.vst.idref=bc3e_ch06-39]!/4[bc3e_ch06-39]/4/222/2@0:0 "Write a function vector merge_sorted(vector a, vector b) that merges two sorted vectors, producing a new sorted vector. Keep an index into each vector, indicating how much of it has been processed already. Each time, append the smallest unprocessed element from either vector, then advance the index. For example, if a is 1 4 9 16 and b is 4 7 9 9 11 then merge_sorted returns the vector 1 4 4 7 9 9 9 11 16"){:target="_blank"} 4/26** .pdf
4/26 | **More Vectors** | [More Vectors](https://medium.com/the-renaissance-developer/c-standard-template-library-stl-vector-a-pretty-simple-guide-d2b64184d50b){:target="_blank"} | | **[LAB 12 Vectors](labs/lab_12.html){:target="_blank"} 5/8**
| | | **[LAB 13 Recursion](labs/lab_13.html){:target="_blank"} _/__** |
| | | |
**5/17** | **FINAL EXAM** | **WEDNESDAY 5/17** | |
2/15 | **Scope &
Lifetime**| [7.3 Local Scope](https://www.learncpp.com/cpp-tutorial/local-variables/){:target="_blank"}
[7.4 Global Scope](https://www.learncpp.com/cpp-tutorial/introduction-to-global-variables/){:target="_blank"}
[7.8 Global Evil](https://www.learncpp.com/cpp-tutorial/why-non-const-global-variables-are-evil/){:target="_blank"}
[7.11 Static Local](https://www.learncpp.com/cpp-tutorial/static-local-variables/){:target="_blank"}
[7.12 Lifetime](https://www.learncpp.com/cpp-tutorial/scope-duration-and-linkage-summary/){:target="_blank"} | |
---
**TEACHER EVALUATIONS:**
[www.hunter.cuny.edu/te](www.hunter.cuny.edu/te){:target="_blank"}
OR
[www.hunter.cuny.edu/mobilete](www.hunter.cuny.edu/mobilete){:target="_blank"} (for smartphones)
---
---
---