Access Keys:
Skip to content (Access Key - 0)

Before each lecture, check this table to find out your assignments that need to be completed before the lecture. It's typically three things:

  • Read Jason's Course Notes 2006 notes - this will introduce you to the topic.
  • Read the online book section - this will introduce you to the Java details.
  • Solve the Turings Craft questions (which are organized by the same book section numbers) - test your programming ability

We will continue to update this page throughout the semester. Expect future lectures and pre-lecture activities to change slightly as the course progresses.

Lecture Handouts and demos are available here.

1/20 Martin Luther King, Jr. Day (No lecture)
1/21 First day of class (Tues / Wed sections)
2/26 Midterm1
3/22-30 Spring Break (no class)
4/2 Midterm2
4/24 (Thursday) Midterm3 (Conflict Wed 4/23)
5/7 Last day of class
5/9-16 Final exams (do not schedule flights home until your last exam is known)

# Date Pre-lecture Activities Part #1 - Bits and Bytes - Digital Computing Architecture
What you should know by the end of lecture
1 1/22 Wed No prep What CS125 is about and how it is organized
2 1/24 Fri Read the course policies
Jason1 - Computer Science and Software Design
Jason2mod - Memory Architecture and Data Modelling
How to do simple data modelling
3 1/27 Mon Sign up to Turings Craft,
Read VonNeumann.pdf
Watch the video
a copy of the sheet in the video.
Von Neumann Architecture
# Date Pre-lecture Activities Part #2 - Procedural Programming - How to write small but useful programs
4 1/29 Wed Jason2 part 2
ch1.3 - The Java Virtual Machine
ch1.4 - Fundamental Building Blocks of Programs
Sign up for Turing's Craft and then complete the practice questions
Program elements
algorithm,composition,Java virtual machine,variables and types,control structures,primitives,subroutines
5 1/31 Fri Read:
ch2.1 Syntax, Semantics, Pragmatics
ch3.2 Programming is difficult (Pseudocode, testing, debugging)
Then Complete Turings Craft questions.
Architecture and Algorithm Development
Developing a program is a four-step cycle: 1. edit (either write a new program, or change an existing program);2. compile (encode program in bit string from); 3. run program through tests to see how well it works ; 4. debug - find errors in the test results and deduce their cause
6 2/3 Mon TC exercises 2.2
Jason3- Types, Variables, and Expressions
ch2.2 Primitive, types, literals, variables
A $370 million mistake and other errors
Variables ; Types; Operators; Expressions; Statements; Variable declaration and assignment.
7 2/5 Wed TC exercises 2.3
ch2.3 Strings, Objects, Enums, and Subroutines
Jason4
Type Checking, Input/Output, and Programming Style
Type Checking and I/O
Type checking examples :String Object
Understand memory allocation, reference variable, the dot operator,
difference between instantiation and creation (which
requires allocation) of an object, and of course the distinction between a class
(description) and object, the allocation.
String instance methods to be illustrated: s1.equals(s2); s1.equalsIgnoreCase(s2); s1.length(); s1.charAt(N); s1.substring(N, M); s1.indexOf(s2); s1.compareTo(s2); s1.toUpperCase(); s1.trim(); +
Input and output
I/O : TextIO ; System.out.println ;
Enumerator / Enumerator constants enum enum-type-name { list-of-enum-values }
8 2/7 Fri TC exercises 2.4
ch2.3 Strings, Objects, Enums, and Subroutines
ch2.4 Text Input and Output
Overcoming Sleepiness
String functions
Passwords, Facebook and Google - Powered by Strings
9 2/10 Mon TC exercises 2.5
Jason5- Boolean Expressions, Simple Conditionals, and
Statements
ch2.5 Operators, expressions and casting
Expressions, conditionals, and statements
Boolean expressions: != ==
Logical operators
Relational operators : Short circuiting ; Using relational and logical operators together ; Conditional introduced and statement redefined
10 2/12 Wed TC exercises 3.1 and 3.5
Jason6- Compound Statements, Scope, and Advanced
Conditionals
ch3.1 Compound Statements, Simple Loops
ch3.5 If revisited
Conditionals and Compound statements
Compound statements;Conditionals with compound statements
Scope: Examples of scope in conditionals;If-else statement; The dangling if-eelse problem
11 2/14 Fri TC exercises 3.3 and 3.4
Jason7- Loops
ch3.3 Looping: do while (break and continue statements are not going to be used in this course)
ch3.4 For loops and Nested Loops
Creativity(video)
Loops
Define loops:Repeating code statements many times
While loop: Single statement; compound statement; do while ;common errors
For loop
The dangling if-else problem
Examples of Loops in action
12 2/17 Mon TC exercises 7.1
Jason8 - One-Dimensional Arrays
ch7.1 Creating and Using Arrays
Assign value to a particular cell: arr[3] = 25;
Read a value from a particular cell: TextIO.putln(arr[0]);
Change a value in a particular cell; arr[3] = foo(someInt);
Single-dimension arrays
Motivation - the need for arrays
Terminology - define array,cells,Index/subscript
Memory allocation with the new operator
Requires a ref variable int[] arr;
Allocates dynamic memory for the array in heap
Syntax: int[] arr = new int[someSize]; The [expr] "bracket" operator expects an integer expression; 0 based array structure
Syntax: collection of a single type;the length property; common errors
13 2/19 Wed TC exercises 7.2
Jason10 - Processing Data Collections
ch7.2 Processing Data Collections. Specifically:
7.2.1) Arrays and for Loops: System.arraycopy()
7.2.5 Arrays of Objects.
7.2.6 Variable Arity Methods: The arity of a
subroutine is the number of parameters
Processing Data Collections
Motivation - the need for processing collections of data
Figure out what we want to do for each cell.
Common Error: ArrayIndexOutOfBoundsException
Terminology: Parallel arrays: The data for a given copy of the message is spread out across several arrays.
14 2/21 Fri TC exercises 7.5 (If they exist)
Jason9 - Multi-Dimensional Arrays
Multidimensional arrays
Motivation - the need for multi-dimensional arrays
Define multi-dimensional array
Usage - show the multi-dimensional array
Syntax: type [][] varname = new Type[sizeOfFirstDimension][sizeOfSecondDimension];
still a collection of a single type
how does the length variable work
Rectangular arrays: what does theMatrix.length return? What does theMatrix.length[0] return?
common errors
15 2/24 Mon ch7.5 Two-Dimensional Arrays draw out a 2D array (left first) and show how the user's
conceptualization can be different whereby the use of the []
operators may symbolize [col][row] or [row][col], depending on
user preference and more importantly, consistency of use.
2/26   Midterm 1 Review Q+A - First Midterm
# Date Pre-lecture Activities Part #3 - Methods and Classes - How to write larger Object Orientated Programs
16 2/28 Fri TC exercises 4.1
Jason11 - Procedural Composition and Abstraction
ch4.1 Procedural Composition
Procedural Composition and Abstraction
Motivation - solving a problem with help
Define: Procedural abstraction - Hide away the implementation details. Encapsulation.
Example: Graphics
17 3/3 Mon TC exercises 4.2, 4.3, 4.4
Jason12 - Method Syntax
lesson1(15 min video), more(optional)
Static methods (class methods) and variables (class variables)
Define: (terminology) function or subroutine;Parameters;Arguments;Return statement;"void" in place of a return type;"public static"
Syntax: Method signature: return-type method-name(t1 p1,...,tn pn);Name;Return type;Zero or more parameters;How the compiler does checks when a method is called;Method definition - code for a method since it defines what the method does; Method call - calling a method: method-name(argument1,...,argument n);
Scope in methods, Parameter variables,Local variables,How the compiler does type checking,Using methods from other classes; className.methodName(arg1,...,argN); the dot operator ;Visual example of method calls (note cards)
18 3/5 Wed ch4.2 Static Subroutines and Static Variables
ch4.3 Parameters (omit 4.35, 4.36 )
ch4.4 Return Values
There are four things that every variable has:
1. A name ; A type; A location in memory; A value.
lesson 18 continued
19 3/7 Fri TC exercises 4.7
More about Methods
ch4.6 Pre and Post-conditions. Bottom up Design
ch4.7 Initialization and scope
Methods (these are static from previous 2 lectures)
Motivation
Define: Global variables;Overloading;Formal parameters or dummy parameters;Actual parameters or arguments
Throwing exceptions : IllegalArgumentExceptions, NumberFormatException.
20 3/10 Mon TC exercises 5.1
Jason13 - Reference Variables and Objects
Jason14 - Objects and Methods
ch5.1 Objects, Instance Methods, and Instance Variables
Objects and reference variables
convert a parallel arrays and non-modular program written in main (one method) into an objected oriented model.
Motivation - abstraction/encapsulation, organization, ease of use, code reuse, conceptualization. Design and building generalized software components
Define: memory allocation and the new operator; Dynamic (heap) memory versus stack (local) memory; 3 types of data storage in Java {primitive type variables, reference variables, object state }
Know the difference between a class and an object. Recall from 5.1 in the reading that an object that belongs
to a class is said to be an instance of that class. The variables that the object contains are called instance
variables. The subroutines that the object contains are called instance methods. If you do not allocate using new you
have no object, and therefore no instance to work with. You need create to allocate, and instantiation represents
only the first step (the intention) to allocate an object.
Usage: Syntax: int [] scores; // declare reference variable scores (initializes to null)
scores = new int[Size]; // allocate the space for the object;
What is a null pointer exception? Are all reference variables automatically initialized to null?
Integration of topics:
Method overloading;Private and public access member specifiers; Getter and Setter methods - defines a property
21 3/12 Wed ch5.1 Objects, Instance Methods, and Instance Variables Previous topics continued
22 3/14 Fri TC exercises 5.2
Jason18 - static versus non-static, and Constructors
ch5.2 Constructors and Object Initialization

Deadline to drop a UG semester course without grade of W
Two kinds of methods: instance method, class method.
Four kinds of variables and when to use them: local variable, parameter variable, instance, class variable.
23 3/17 Mon ch5.3.1,ch5.3.3
Programming with Objects
Understand these terms:
Java features: Built in classes (5.3.1); The class "Object";Hash code; The toString() method.
Subclasses (more in 5.5 when we talk about inheritance)
24 3/19 Wed TC exercises 5.4
ch5.3 continued
Lesson 23 continued
25 3/21 Fri TC exercises 5.5
ch5.5 Inheritance, Polymorphism, and Abstract Classes
ch5.6 this and super
Inheritance in Java
    Spring Break    
26 3/31 Mon ch8.2 Writing correct programs
ch8.3 Exceptions and try..catch
Recursion on Linked Lists
4/2 Wed   "Review" Lecture and Second Midterm
# Date Pre-lecture Activities Part #4 - Recursion - How to write recursive programs
27 4/4 Fri Chortle 71 (alternate server:71) Recursion II
28 4/7 Mon Chortle 72(alternate) Activation Diagrams
29 4/9 Wed   Tail Recursion
30 4/11 Fri Chortle73(alternate), Jason24 Recursive counting
31 4/14 Mon ch9.1.1, Jason26 Recursive searching
32 4/16 Wed Jason27 Recursive sorting
# Date Pre-lecture Activities Part #5 - Algorithm Analysis - A quick study of sorts
33 4/18 Fri   Algorithm analysis and Big O notation.
34 4/21 Mon Jason31,32 Introducing Quicksort and Merge sort.
4/23 Wed   Review Q+A Lecture - Third Midterm Wed/Thu
35 4/25 Fri Jason33 Analysis of iterative methods
36 4/28 Mon   How Mergesort works and why Mergesort is always O(N Lg N) with O(N)  
37 4/30 Wed Jason35 Algorithm Analysis and Final Exam Practice
38 5/2 Fri Jason38,39 Jason40 Why Quicksort is usually O(N Lg N) and requires no additional space.
39 5/5 Mon TBA Parallelism I
40 5/7 Wed Advice Parallelism II
Adaptavist Theme Builder (4.2.2) Powered by Atlassian Confluence 3.4.9, the Enterprise Wiki