CS Department   Mt. Holyoke College
CS 101
Problem Solving and Object-Oriented Programming

Course Schedule

The following publications are referred to on the schedule below:

Adams
Joel Adams, Alice in Action: Computing through Animation, Thomson Course Technology, 2007.
Bruce
Kim Bruce, Andrea Danyluk and Thomas Murtagh, Java: An Eventful Approach, Prentice Hall, 2007.
Sep. 4: Introduction to Alice and Objects
Readings: Adams, Chapter 1
Sep. 9: Methods
Readings: Adams, Chapter 2
Examples
Sep. 9/10: Alice Lab 1
Sep. 11: Variables and Functions
Readings: Adams, Chapter 3
Examples
Sep. 16: Flow control
Readings: Adams, Chapter 4
Examples
Sep. 16/17: Alice Lab 2
Demo
Sep. 18: Loops and Lists
Readings: Adams, Chapter 5, excluding 5.2
Examples
Sep. 23: Event Handling
Readings: Adams, Chapter 6
Examples
  • Skaters - download and open in Alice
  • Skaters - demonstrates partNamed function and reacting to keyboard and mouse input
Sep. 23/25: Alice lab 3
Demo
Sep. 24: Mountain Day!
Sep. 30: More Alice Practice
Readings: None
Examples
Sep. 30/Oct. 1: Work on test program.
Handout
Dribbling contest animation
Dribbling contest solution
Ice skating routine animation
Ice skating routine solution
Oct. 2: Randy Pausch, the creator of Alice, speaks on Really Achieving Your Childhood Dreams
Oct. 7: Graphics and Event Handling in Java
Readings: Chapter 1
Slides
Examples
  • SpringBreak - First Java program demonstrating simple mouse event handling
Oct. 7/8: Java Lab 1 - Introduction to Java
Handout
Oct. 9: Objectdraw graphics
Slides
Examples: These examples show how to define a class containing a constructor that uses graphical objects to create a simple drawing of a stick figure.
  • Stick figure - This version uses integer literals when constructing the shapes. It is easy to create, but hard to modify since it is not clear how the numbers relate to each other.
  • Stick figure 2 - This version uses named constants. This results in a longer program, but we can change a single value, like the size of the head and have that change propagate to the sizes and locations of all the shapes.
  • Stick figure 3 - This version has a location parameter in the StickFigure constructor. This allows different stick figures to be drawn at different locations on the screen. To accomplish this, the names used to represent the locations of the body parts must be changed to variables since they do not have a single value. Each stick figure has a different value for where its head should be, for example.
Oct. 16: Centering, Colors and Randomness
Readings: Chapters 2 and 3
Slides
Examples
Oct. 21: Dragging
Readings: Chapters 4-5
Slides
Examples
  • Mystery - Draws rectangles of random size at random locations and with random colors as the user moves the mouse.
  • HideAStickFigure - First example of dragging code
  • BestBasketball - Second example of dragging code
Oct. 21/22: Java Lab 2 - Draw a Penguin
Handout
Demo
Oct. 23: Signatures
Readings: 6.1-6.2
Slides
Examples
  • MysteryDrawing - Demonstrates use of an instance variable to remember the starting point for all the lines drawn during a drag
Oct. 28: Classes, Declarations and Scope
Readings: Chapters 6.3-6.7, 8
Slides
Examples
Oct. 28/29: Java Lab 3 - Hot air balloon
Handout
Running program
Oct. 30: While Loops
Readings: Chapters 7
Slides
Examples
Nov. 4: Midterm review
Slides
Examples
Nov. 4/5: No lab - Study for midterm.
Nov. 6: Midterm
Objectdraw reference - I will give you a printed copy of this with the midterm exam.
Sample questions
Sample answers
Nov. 11: While loops
Slides
Examples
Nov. 11/12: Java Lab 4 - While loops
Handout
Running program
Picture.java - You need to import this class into your project. You should not modify this class!
A photograph to manipulate
Nov. 13: For loops and Arrays
Readings: 13, 14.1-14.5
Slides
Examples
Nov. 18: Arrays
Examples
Nov. 18/19: Java Lab 5 - Arrays
Handout
Running program
Nov. 20: Debugging
Slides
Calculator example
  • Calculator - Used to demonstrate debugging strategies
Nov. 25: Program execution
Slides
Moving rectangles example
  • Moving rectangles - Demonstrates how object changes can be seen through multiple variables
Dec. 2: Strings
Readings: Chapter 16
Slides
Examples
Dec. 2/3: Java Test Program
Handout
trashempty.png
Demo of the test program
Dec. 4: Strings
Slides
Examples
Dec. 9: Cryptography
Slides
Dec 11: Exam Review
Readings
Sample questions
Sample answers
Slides