CSCI 135 ANALYSIS & DESIGN 1 HUNTER COLLEGE CITY UNIVERSITY OF NEW YORK

In this course, which is 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      Gradescope      Coding Style Guide     FAQ  

Schedules for Code Review (updated)                    Cheat sheet

Text: Cay Horstmann, Brief C++, 3rd ed. eText – please rent the eText for one semester from here – do not buy or rent it from Amazon or Kindle store – you will not get access to the necessary interactive material!

Linux on Windows Tutorial: https://okunhardt.github.io/documents/Installing_WSL.pdf

Tutoring: The tutors for this course are available in the Lab HN1001B.

The tutors are there to help you with all of your labs, assignments, and projects! Get as much help as you need.

Lecture: Monday, Thursday 8:30 – 9:45 AM at HN118,

Lecture Instructor: Tong Yi HN1001 L Office hours: Monday, Thursday 10:00 – 11:30 AM and by appointment, ty680@hunter.cuny.edu

Questions You must get hands-on programming help in person during your lab or from tutors in lab B. We will never debug your code over email. You should ask questions during the lecture and the recitation. All other email questions must be sent to your lab instructor listed below. You must always include your section, name of lab instructor, your name and EMPLID.

Section

Time

Location

Instructor

E-mail

9048 1R01

Mo 1:10 – 3:00 PM

HN 1001C

Ken Ko

ken.ko17@login.cuny.edu

9047 1R02

Mo 3:10 – 5:00 PM

HN 1001C

Ken Ko

ken.ko17@login.cuny.edu

9046 1R03

Mo 5:30 PM – 7:20 PM

HN 1001C

Daniel Mallia

DANIEL.MALLIA21@login.cuny.edu

9045 1R04

We 10:10 AM - 12:00 PM

HN 1001C

Mohammad Shokri (Shayan

mshokri@gradcenter.cuny.edu

9044 1R05

We 12:10 PM - 2:00 PM

HN 1001C

Artjom Plaunov

ap939@hunter.cuny.edu

9043 1R06

We 4:00 PM - 5:50 PM

HN 1001C

Artjom Plaunov

ap939@hunter.cuny.edu

9042 1R07

Th 3:10 PM - 5:00 PM

HN 1001C

Brandon Foster

brandon.foster81@myhunter.cuny.edu

9041 1R08

Th 5:30 PM – 7:20 PM

HN 1001C

Brandon Foster

brandon.foster81@myhunter.cuny.edu

5637 1R09

Tu 5:30 PM – 7:20 PM

HN 1001C

Heng Li 

hli5@gradcenter.cuny.edu

7789 XCSR

We 11:10 AM – 1:00 PM

HN 1001G

Melissa Lynch

ml4139@hunter.cuny.edu

 

COURSE OUTLINE

DATE

TOPIC

READING: Brief C++                                

SLIDES

DUE DATES

8/28

Syllabus

Gradescope

eText features

C++ Review

Introduction

Fundamental Data Types

Decisions

1.5 Analyzing Your First Program

1.6 Errors

2.1 Variables

2.2 Arithmetic

3.7 Boolean Variables and Operators

3.1 The if Statement

3.2 Comparing Numbers and Strings

3.3 Multiple Alternatives

3.4 Nested Branches

3.8 Application: Input Validation

1.5

1.6

2.1

2.2

3.7

3.1

3.2

3.3-4

3.8

Lecture note

Hints for Lab 1

Video for syllabus introduction

Video for variable, input and output

Video for branch statements

VS Code set up

Debug using online gdb

Video for Debug using online gdb and Visual Studio Code

Code Review 1  9/1

LAB 1  Intro to Linux and to C++   9/5

E1.7  Enter three names from console, then print them, one a line 9/9

WE 2.1

WE 2.2

WE 3.1

E3.1   9/9

E3.5   9/9

PS 3.5

PS 3.6

8/31

Input and output 

loops

2.4 PS First Do It By Hand

2.3 Input and Output

4.1 The while Loop

4.3 The for Loop

4.4 The do Loop

6.1 Arrays

2.3-4

4.1

4.2-3

4.4-5

6.1

Review of CPP II note

Array note

Hints for Lab 2

Project 1A   9/12

E2.10   9/16

E4.8   9/16

PS 2.4

PS 4.2

WE 4.1

WE 4.2

9/7

 Strings

2.5 Strings

Project 1C & 1D

2.5

Introduce to string

Lab 1 Code Review 9/11

Project 1B   9/19

Project 1C   9/26

9/11

Common loop examples

4.6 PS Storyboards

4.7 Common Loop Algorithms

4.8 Nested Loops

4.6-8

Loop examples

Hints for Lab 3

Videos for loop algorithms and nested loops

Videos for hints of lab 2c and lab 3

PS 4.6

PS 4.9

LAB 2  Loops and Arrays   9/11

Project 1D   10/3

9/14

More Loops

Random numbers

4.9 PS Solve a Simple Problem First

4.10 Random Numbers and Simulations

Shapes of asterisks

4.9-10

Hints for Project 1B

Hints for Project 1C and 1D

Hints for Lab 4

Asterisk pattern

Nested loop

Introduction to random numbers and Monte Carlo

Nested loop video

Asterisk shape video

Lab 3 hints video

Monte Carlo simulation Video

Questions answered

9/18

Functions

5.1 Functions as Black Boxes

5.2 Implementing Functions

5.3 Parameter Passing

5.4 Return Values

5.5 Functions without Return Values

5.6 PS Reusable Functions

5.1-3

5.4-6

Run Code

Method introduction

Define method

Video for method introduction

Video for define bottom right triangle function

Video for define isPrime function

Questions answered

WE 5.1

WE 5.2

WE 5.3

E5.6   9/30

PS 5.6

 

LAB 3  File I/O, Process Data   9/18

Lab 2 Code Review 9/18

9/21

 Scope

Static Vars

Streams

5.7 PS: Stepwise Refinement

5.8 Variable Scope and Global Variables

5.9 Reference Parameters

\–/ Static Variables

8.1 Reading and Writing Text Files

 5.7

5.8

5.9

StatVar

8.1 

Viz

Pyramid

Lecture for more functions

Video for hints on Project 1 tasks c and d, lab4, lab5

Video to define functions with examples bottomRightTriangle and isPrime

Video to define function to convert integers to English name; pass by reference

Code link to isPrime

Code link of integer converted to English name

Code link to swap two integers using passing by reference

Questions answered

PS 5.7

E5.14 E5.15 9/30

E8.1 9/30

WE 8.1

LAB 4  Printing Shapes 9/26

9/28

 Arrays

 

 

6.1 Arrays

6.2 Common Array Algorithms

0’s, Squares, Copy, Sum, Avg, Min, Max, Search, Remove unordered

Remove ordered, Insert unordered, Insert ordered, Read inputs and find largest, 

6.3 Arrays and Function

Pass by value vs. Pass by Reference (Hints for E5.14 and E5.15)

Hints for Lab 5

Hints for Lab 6

6.1

6.2

6.3

Slides for lecture

video of hints for Lab 5, Lab 6, and file read/write

video of array algorithms (zero, squares, copy, sum, average, max, min)

questions answered

WE 6.1

WE 6.2

Selection Sort

Project 2 A 10/17 10/24

Project 2 B 10/24 10/31

Project 2 C 10/31 11/7

Project 2 D 11/7 11/14

10/2

 Arrays

Array functions

6.4 PS: Adapting Algorithms

6.5 PS: Discovering Algorithms by Manipulating Physical Objects

7.4 Dynamic Memory Allocation

 6.4-5

Project 2 minesweeper simplification

Array pointer

Dynamic allocated memory

Object oriented programming with Fuel Tank

Search in an array

Video of defining function to calculate array average and array minimum

Videos of arrays and pointers

Videos of dynamic memory allocation

Minesweeper project introduction

Video of FuelTank class part1

array_average.cpp

array_min.cpp

array_copy_cannot_use_assignment.cpp

array_copy.cpp

double_number_approximate.cpp

dynamic_array_demo.cpp

dynamic_array_method.cpp

 

LAB 5  Functions and

Prime Numbers 10/2

Lab 3 Code Review 10/2

PS 6.4

PS 6.5

Binary Search

E6.8   10/14

 

10/5

Pass by

Reference

Pointers

7.1 Defining and Using Pointers

Pointers Example

Coffee

Code

By Value

By Ref.

Slides of pointer

7.1

Ptrs from Professor Maryash

Midterm review

Object oriented programming with Fuel Tank

Slides of searching in an array

Code of linear search

Code of binary search

Code of using int*

Code of swap(int*, int*)

Video of section 7.1 pointer

Video of swap parameters as pointers

Video of linear search and binary search

Video of FuelTank class

Code of FuelTank class and main.cpp to test it

Questions answered in black and white

Questions answered in colored code

 

WE 7.1

PS 7.6 (1 and 3 only)

LAB 6 Strings and Ciphers  10/10

Lab 4 Code Review 10/10

E7.1   10/14 

10/10*

Tuesday follows Monday’schedule

Midterm review

Video to explain cheat sheet part1

Video to explain cheat sheet part 2

Code of shiftChar function

 

10/12

 

Review for mid term

Video of multiplying elements of an array by a factor and read file data and create dynamically allocated memory

 

Video of read file data and create dynamically allocated memory: part II

 

Video of swap half of an array with even size; remove an array element by index

 

Code of multiply by elements of an array by a factor

 

Code of reading a file and put its data into a dynamically allocated array

 

Code of removing an array element by index

 

Swap the first half of an array with the second half if the array size is even

LAB 7 Automatic Style   10/23

Lab 5 Code Review 10/17

 

10/16

MIDTERM EXAM

 

 

 

 

10/19

Project 2

Minesweeper simplification

9.1 Object-Oriented Programming

9.2 Implementing a Simple Class

 

 

Project 2 minesweeper simplification

Field.hpp

Field.cpp

Game.hpp

Game.cpp

TestGame.cpp

makefile

zip all files of Minesweeper project

9.1-2

Hamburger class introduction slides

video of introduction to Hamburger class

video of Field class constructors

 

10/23

Project 2 continued

Hints for Lab 8

Slides of class introduction

Video of class introdution (why class)

Video of constructors in Field class

Video of neighbor_mines and answer_string method of Field class

Videos are posted in blackboard -> course materials

10/26

Dynamic Memory

6.6 Two-Dimensional Arrays

Print 2D array 

6.6

Video of one-dimensional array review, shiftChar using array of char

Video of two-dimensional array introduction

code of statically allocated 1d array example

shiftChar.cpp

LAB 8  Image Processing   10/30 11/2

10/30

two- dimensional array

 

Minesweeper project Task C

6.6 Two-Dimensional Arrays

Video of two-dimensional array declaration and initialization, print out, and row sum

Video of finding column sum of a 2d-array

Video of Minesweeper Project Task C

Code to declare, initialize, print, and sum by row and column of 2d-array

Code of wrong declaration and initialization of 2d-array

11/2

7.2 Arrays and Pointers

Code

Viz

7.8 Pointers and Objects

5.9 Reference Parameters

7.5 Arrays of Pointers

Galton Board

7.2

7.4

7.5-6

Viz

Ptrs

Viz

5.9_Slides

Galton Board slides

Lab 9 hints

Code of declare and initialize of 2d array – NUM_COLS must be specified

Code of connection between pointer and an array

Code of Galton Board

video of 2d-array declaration and initialization

code of 2d-array declaration and initialization (showing address of each element as well)

video of Galton Board part 1

video of Galton board part II

video of Galton board part III (release dynamically allocated memory)

code of Galton board in video (comments slightly modified)  

LAB 9  Pointers 10/30 11/5

WE 9.1

11/6

Enumerations

Class and objects 

7.6 PS Draw a Picture 

7.7 Classes of Objects

 

 

Viz 

7.7-8

Skeleton code of class Address and Employee (example in Section 7.7-8)

Pdf file of the above skeleton code

video of triangle-shape 2d-array (array of pointers to ints)

code of programming exercises in lecture slip of 11/2/23

video of hints for project 2c and 2d

answer to attendance sheet (bw pdf)

answer to attendance sheet (colored pdf)

video to explain answer to attendance sheet

Lab 9 Code Review 11/9

11/9

 

9.1 Object-Oriented Programming

9.2 Implementing a Simple Class

The switch Statement

Enumerated types: bool, switch, MyBool, LIKELY, Color, Colors

9.3 Specifying the Public Interface

9.4 Designing the Data Representation

9.5 Member Functions

Project 3 Game 1024

9.1-2

Code

Enums

9.3-5

Code

 

Game1024 simplification

 

Board.hpp

 

TestBoard.cpp

 

makefile

 

videos on blackboard

 

E7.16   11/14

E7.18   11/14

LAB 10  Classes, Enums   11/13

 

11/13

9.6 Constructors

9.9 Separate Compilation

9.6

9.9

Videos in blackboard due to size limit

vector slides

Project 3A 11/14 11/21 11/24

Project 3B 11/20 11/27

Project 3C 11/27 12/5

Project 3D 12/5 12/11

Hints on Project 3B

Hints on Project 3C

Hints on Project 3C black and white, colored (new)

Hints on Project 3D

 

11/16

 vectors

6.7 Vectors

More Vectors

6.7

LAB 11  More Classes   11/20 11/21

Hints for Lab 11 colored copy

Hints for Lab 11 black and white copy

E6.18  E6.20   11/25

11/20

Class and Objects

Pointers to Objects 

Static Member Variables  

9.10 Pointers to Objects

9.11 PS: Patterns for Object Data

Static Variables

Static Member Variables

 9.10-11

StatVar

StatMV

CashRegister of Section 9.3-9.9 (preferred implementation)

CashRegister implementation v2

CashRegister implementation v1

Computer class and its tester

LAB 12  Vectors  11/27

E9.3   12/5

E9.5   12/5

Requirements for E9.3 and E9.5

11/27

Inheritance

10.1 Inheritance Hierarchies

10.2 Implementing Derived Classes

10.3 Overriding Member Functions

10.4 Virtual Functions and Polymorphism

10.1

10.2

10.3

10.4

Inheritance with Question and ChoiceQuestion examples

Question and ChoiceQuestion code

Videos in blackboard

Debugger LAB

Lab 13 12/14

Hints for lab 13 are in blackboard

Hints on Project 3C black and white, colored (new)

Hint for Lab13 Task F

11/30

Inheritance and Polymorphism

 

12/4

Polymorphism

 

Recursion

Introduction to recursion

Polymorphism slides with vet-animal example

Slides

Slides from textbook

Question, ChoiceQuestion, NumericalQuestion code

Animal, Dog, Cat, Vet classes code

12/7

Review

review

Materials in blackboard

10 Extra

WE 10.1

12/11

Review

Review

 Materials in blackboard

 

 

12/14

Final

9:00 – 11:00

 

 


TEACHER EVALUATIONS:

www.hunter.cuny.edu/te
OR
www.hunter.cuny.edu/mobilete (for smartphones)

Entry code for gradescope: VBG5EB