Computer Science 120
Introduction to Programming
Fall 2011, Siena College
Class Examples
Class examples are linked below. Please report any missing examples.
- January 20
-
- TouchyWindow - basic event handlers and Text object
- ColorEvents - more graphics primitives, more event
handlers, setting colors.
- SunAndMoon - moving objects in response to events
- MouseDroppings - accessing the mouse location
- Spirograph - remembering a mouse location in an
instance variable
- January 25
-
- Scribble - update the saved location on each drag event
- RubberBand - changing the endpoint of a line
- ClickCounter - using an int variable,
changing the contents of a Text object, constructing a string
from an int
- Rectangles - basic conditional, the null object
- NudgeBall - testing for containment of a point in
a graphics object
- ColorfulSpirograph - RandomIntGenerator to
select among a limited set of colors
- January 27
-
- February 3
-
- February 8
-
- NiceBasketball - a fancy-looking basketball (that
just sits there)
- Arcs - examples of FramedArc and FilledArc objects
- February 10
-
- FancyBasketball - a class defining a fancy
basketball used by another class
- February 15
-
- February 17
-
- February 22
-
- February 24
-
- VanishingScribble - a scribble program enhanced with some active objects
- PatheticPong - first attempt at a pong game, this
one with a paddle that does not interact with the ball
- LessPatheticPong - the ball can now be struck by the paddle
- March 1
-
- Pong - the ball can now bounce off the walls
- TiltPong - communicating with the active object in pong
- FallingSnow - multiple active objects
- Snowman - importing and using graphical images
- March 8
-
- March 22
-
- March 24
-
- March 29
-
- Drag10ShirtsNicer - array with initializer
- Drag20Shirts - reuse colors using modulo arithmetic
- DrawRoads - draw segments of roads, using a loop to draw center lines
- DragRoads - drag a segment of road, uses array to store road segment components
- DragAllRoads - drag any segment of road, also uses array to store all road segments
- DragStudents - drag around pictures of students, using a random non-overlapping placement
- March 31
-
- April 5
-
- April 7
-
- Breakout - a breakout game using 2D arrays and
lots of other fun things
- April 12
-
- BetterBreakout - an improved breakout game, with a turn
counter, as developed in class
- April 14
-
- Hangman - a text-based hangman game, demonstrating
some String methods, reading a file, reading from the keyboard
- April 28
-
- ATM1 - demonstrating the dangers of concurrency
- ATM2 - demonstrating the dangers of concurrency
- ATM3 - demonstrating how to avoid the dangers of concurrency