PAC I Notes & Code

Professor Evan Korth

Clinical Associate Professor
Computer Science Department
Courant Institute of Mathematical Sciences
New York University

Email (add @cs.nyu.edu): korth
251 Mercer Street, Room 319
New York City, 10012
Tel.: 212-998-3301



Notes & Code

Class DATE Topic
Class Programs
Readings
Class Lectures
1 Sep 5 Programs from chapter 2 slides : ComputeArea.html, DisplayTime.html, FahrenheitToCelsius.html, SalesTax.html, DisplayUnicode.html, ComputeLoan.html, ComputeChange.html, ShowCurrentTime.html, TestScanner.html
Programs from chapter 3 slides: LeapYear.html, LearnAddition.html, ComputeTaxWithSelectionStatement.html, SubtractionTutor.html, GuessBirthDate.html
Programs from chapter 4 slides: SubtractionTutorLoop.html, SentinelValue.html, TestSum.html, TestMultiplicationTable.html, GreatestCommonDivisor.html, FindSalesAmount.html, PrintPyramid.html, TestBreak.html, TestContinue.html, PrimeNumber.html
More examples of programs can be found here
Intro to class
CPAC Java Procedural Fundamentals COMPLETE
CPAC Java Procedural Fundamentals SHORT
Liang slides: Liang Chapter 2
Liang Chapter 3
Liang Chapter 4
1R Sep 10
2 Sep 12
2R Sep 17 Primitive data types Recitation notes
3 Sep 19 See lectures 1 and 2 CPAC Java Procedural Fundamentals COMPLETE
CPAC Java Procedural Fundamentals SHORT
3R Sep 24 Loops and conditional statements Recitation notes
4 Sep 26 TestMax.html, TestPassByValue.html, TestMethodOverloading.html, ComputeTaxWithMethod.html, PrintCalendar.html, PrintCalendarSkeleton.html
Also see corresponding notes and lectures from my Spring 2007 0002 class
Liang Chapter 5
CPAC Java Methods COMPLETE
CPAC Java Methods SHORT
4R Oct 1 Discuss Assignment 1
Review for quiz (primitives, control structures, methods)
 
5 Oct 3 Array1.txt, Array2.txt, Array3.txt, Histogram.txt, RollDie.txt, StudentPoll.txt, TestPassArray.txt, MakeHot.txt, MakeArrayInMethod.txt, TestCopyArray1.txt TestCopyArray2.txt, TestCopyArray3.txt CPAC Java arrays
5R Oct 8 Quiz (primitives, control structures, methods)
6 Oct 10 TestCircle.txt, TestSwitch.txt, TestCircleWithConstructors.txt, TimeTest1.txt
CircleWithAccessors.txt, TestCircleWithAccessors.txt, CircleWithStaticVariable.txt, TestCircleWithStaticVariable.txt, TestDate.txt
TestSmallInt.txt
CPAC Object Oriented Programming 1-3
7 Oct 17 TotalArea.txt
Inheritance: GeometricObject.txt, Circle.txt, Rectangle.txt, TestCircleRectangle.txt
Cylinder.txt, TestCircleCylinderRectangle.txt
Inheritance, Object class, Intro to Polymorphism: modify programs from above
Arrays of Objects
Inheritance
Inheritance, Object class, Intro to Polymorphism (also arrays of objects review)
6R Oct 22 MIDTERM, part 1  
8 Oct 24 Midterm Review: TestRectangle.txt Rectangle.txt
HourlyEmployee.txt, TestHourlyEmployee.txt

Casting objects and abstract classes: Same class hierarchy with equals() methods and test instanceof operator
GeometricObject.txt, Circle.txt, Rectangle.txt, Cylinder.txt, TestCircleCylinderRectangle.txt
TestCircleCylinderRectangle2.txt (try both GeometricObject files), GeometricObject.txt (with abstract methods)
Employee.txt, SalariedEmployee.txt, HourlyEmployee.txt, CommissionEmployee.txt, BasePlusCommissionEmployee.txt, PayrollSystemTest.txt
Inheritance, Object class, Intro to Polymorphism (also arrays of objects review)
casting objects and abstract classes
7R Oct 29 class canceled for Sandy  
9 Oct 31 class canceled for Sandy  
8R Nov 5 Review for midterm (classes, inheritance, polymorphism) Recitation notes
10 Nov 7 Interfaces: LinearSearch.txt, BinarySearch.txt, SelectionSort.txt, BubbleSort.txt
TestComparableBinarySearch.txt, TestComparableMax.txt
String.txt (from the Java API), MyString.txt, TestMyString.txt
(solution using only stuff from this class - still not modular) Person.txt, Employee.txt, Student.txt, Staff.txt, Faculty.txt, TestPerson.txt
(solution using some concepts we have not covered but can understand - this is more modular - can still be improved) Person.txt, Employee.txt, Student.txt, Staff.txt, Faculty.txt, TestPerson.txt
Building.txt, AcademicBuilding.txt, ResidentialBuilding.txt, EmployeeHousing.txt, Dormitory.txt, TestBuilding.txt
LinkedNodes.txt (see non-recursive print method)
interfaces
Big Oh and Linked Lists
9R Nov 12 MIDTERM, part 2  
11 Nov 14 cut and paste from slides for recursive programs
TicTacToe.txt, TestLength.txt, TestMatrixOperation.txt, GradeExam.txt
StringLogInterface.txt, ArrayStringLog.txt, LLStringNode.txt LinkedStringLog.txt, UseStringLog.txt
Recursion
Arrays 2
10R Nov 19 Midterm answers, Java API Recitation notes
12 Nov 21 HandleExceptionDemo.txt
Stack code from book (minus package statements): StackOverflowException.txt, StackUnderflowException.txt, StackInterface.txt, BoundedStackInterface.txt, UnboundedStackInterface.txt, ArrayStack.txt, ArrayListStack.txt, ReverseStrings.txt, LLNode.txt, LinkedStack.txt, PostCalc.txt
Exception Handling
Generics
11R Nov 26 packages, Java API documentation, postfix & infix expressions Recitation notes
13 Nov 28 Queue code from book (minus package statements): QueueUnderflowException.txt, QueueOverflowException.txt, QueueInterface.txt, BoundedQueueInterface.txt, UnboundedQueueInterface.txt ArrayBndQueue.txt, ArrayUnbndQueue.txt, LLNode.txt, LinkedUnbndQueue.txt, RepeatStrings.txt
ListInterface.txt, IndexedListInterface.txt, ArraySortedList.txt, ArrayUnsortedList.txt, ArrayIndexedList.txt, LLNode.txt, RefSortedList.txt, RefUnsortedList.txt
 
12R Dec 3 Wrote basic implementations of a list, queue, and stack. Recitation notes
14 Dec 5 TreeTraversal.txt, ExpressionTree.txt
Review Searches: LinearSearch.txt, BinarySearch.txt
BSTNode.txt, BSTInterface.txt, BinarySearchTree.txt
Trees lecture
Binary Search Trees
13R Dec 10 Quiz (lists, queues, stacks)  
14R Dec 12    
Final Dec 19 Final Exam