CPSC 124 Introduction to Programming Fall 2004

CPSC 124 Syllabus

 AssignmentsImportant Dates

Week 1: 8/30-9/3

Topics: introduction, structure of a basic java application, variables, primitive types, strings, objects, subroutines

Reading: chapter 1; chapter 2, sections 2.1-2.3
Plan to do the readings before coming to class, so that class time can be spent on addressing questions and trickier topics.

Examples: HelloWorld.java, TempConvert.java

       
       
       
  lab #1: Introduction
due R 9/9 at the start of lab
   
     

Week 2: 9/6-9/10

Topics: strings, objects, subroutines, text input/output, expressions, algorithm design, introduction to 'while' and 'if'

Reading: 2.3-2.5, 3.1-3.2, 3.5-3.6

Examples: MathStringDemo.java, TextIODemo.java

quiz #1
due W 9/8 by class
   
   
     
  lab #2: Java Programs and TextIO
due R 9/16 at the start of lab
   
     

Week 3: 9/13-9/17

Topics: conditionals and loops (if, switch, while, do...while, for)

Reading: 3.5-3.6, 3.3-3.4

Examples: Folding.java, DiceCount1.java (if-else statements), DiceCount2.java (switch statements), Looping1.java, Looping2.java, Looping3.java (three different ways to write a sentinel loop), LoopComparison1.java (while vs. for), LoopComparison2.java (while, do-while, for)

quiz #2
due W 9/15 by class
   
   
     
  lab #3: Conditionals and Loops
due R 9/23 at the start of lab
   
     

Week 4: 9/20-9/24

Topics: more loops; subroutines, parameters, return values

Reading: 3.3-3.4, 4.1-4.4

Examples: TimesTables1.java, TimesTables2.java (nested loops), CountHeads.java (finding maximums), HelloWorld2b.java (subroutines and javadoc-style comments), GuessingGame1.java, GuessingGame2.java (subroutines), GuessingGame3.java (constants), BeerSong.java, BeerSong2.java (parameters)

quiz #3
due W 9/22 by class
   
   
     
  lab #4: Networking, Loops, and Pseudocode
due R 10/7 at the start of lab
   
     

Week 5: 9/27-10/1

Topics: subroutines, parameters, return values

Reading: 4.1-4.4

Examples: TempConvert3.java (subroutines with parameters and return values)

quiz #4
due W 9/29 by class
   
   
    no class
W 9/29
    no lab
R 9/30
    no class
F 10/1

Week 6: 10/4-10/8

Topics: subroutines, parameters, and functions, more about declarations, exam

Reading: 4.1-4.4, 4.7

Examples: Palindrome.java, Palindrome2.java (subroutines with parameters and return values), LeapYear.java (subroutines with parameters and return values, and some syntax shortcuts)

  programming assignment #1: Secret Messages
due W 10/20 5pm
 
review session
T 10/5 7pm
 
   
  lab #5: Subroutines and Functions
due R 10/14 at the start of lab
 
exam #1
F 10/8
(solutions - PDF format)
 

Week 7: 10/11-10/15

Topics: intro to applets and graphics, web pages, toolboxes, APIs, packages

Reading: 3.7, 6.2, 4.5

Examples: pseudocode for card games, BasicApplet.java and basicapplet.html, SimpleApplet.java and simpleapplet.html, IllusionApplet.java and illusion.html (applets), SimpleAnimApplet.java and simpleanimapplet.html, SimpleAnimApplet2.java and simpleanimapplet2.html, SimpleAnimApplet3.java and simpleanimapplet3.html (animation in applets)

the applets should run in Konqueror when you click on one of the HTML links; if they don't run in your browser, use "Save Target As" or "Save Link As" to save the .java file and the .html file from the link and then compile the .java file and run using appletviewer

(to see the HTML source for the web page, do "View Source" in your browser after clicking on one of the HTML links)

  fall recess
M 10/11 - T 10/12
 
   
  lab #6: Applets and Graphics
due R 10/21 at the start of lab
 
   

Week 8: 10/18-10/22

Topics: program design, objects

Reading: 4.6, 5.1-5.2

Examples: MathQuiz.java (design with subroutines), Dice.java, DicePair.java (writing classes), DiceTester.java (using objects)

quiz #5
cancelled - work on programming assignment #1
 
 
   
  lab #7: Animation and Mosaics
due R 10/28 at the start of lab
programming assignment #2: Snake Pit
due W 11/10 5pm
 
   

Week 9: 10/25-10/29

Topics: objects, object-oriented design

Reading: 5.1-5.2, 5.3

Examples: HotAirBalloon.java (writing classes), Balloons.java and balloon.html (using classes, instance variables, applet init method), War.java (using objects)

quiz #6
due W 10/27 by class
 
 
   
  lab #8: Using Objects
due R 11/4 at the start of lab
 
   

Week 10: 11/1-11/5

Topics: more about objects and classes - inheritance, polymorphism, abstract classes, interfaces

Reading: 5.4-5.6

Examples: program design - the goal of the roulette design was to decide what classes there should be, and to group methods and variables with the classes they most belong to: RouletteWheel.java, Gambler.java, Bet.java, Roulette.java (main program)

Examples: inheritance and polymorphism: Rectangle.java, RoundedRectangle.java, RectDemoApplet.java (applet to demo Rectangle and RoundedRectangle), rectdemoapplet.html (web page for running applet)

Examples: inheritance and abstract classes: Shape.java, Rectangle2.java, RoundedRectangle2.java Oval.java, Circle.java, ShapeDemoApplet.java (applet to demo), shapedemoapplet.html (web page for running applet)

Examples: inheritance and polymorphism: A1.java, B1.java, Test1.java (which method gets called)

quiz #7
cancelled - work on programming assignment #2
 
 
   
  lab #9: Creating Classes
due R 11/11 at the start of lab
 
   
   
optional extra lab session
Sun 11/7 4-6pm
Lansing 310
 

Week 11: 11/8-11/12

Topics: abstract classes, interfaces, more about applets and GUI programming

Reading: 5.4-5.6, 6.1, 6.3-6.6

Examples: application of abstract classes and inheritance: Nim.java (main program), NimPlayer.java (generic player), HumanNimPlayer.java (human player), ComputerNimPlayer.java (computer player)

Examples: a basic Swing applet (compare to SimpleApplet.java above): SimpleJApplet.java, SimpleJPanel.java, simplejapplet.html

Examples: mouse clicks: PaintSplotchApplet.java, PaintSplotchPanel.java, paintsplotch.html

quiz #8
due W 11/10 by class
 
 
   
review session
R 11/11 6:15pm
review topics
lab #10: Inheritance, Swing, and Events
due R 11/18 at the start of lab

final project: Choose Your Own Game
due F 12/10 5pm

project design
due before you leave for Thanksgiving break (T 11/23 5pm)

 
exam #2
F 11/12
(solutions - PDF format)
 

Week 12: 11/15-11/19

Topics: GUI programming

Reading: 6.3-6.6, 7.4 (about animation and timers); the rest of chapter 7 is optional reading for those who are interested in more advanced GUI topics

Examples: mouse clicks, buttons, and BorderLayout (with some abstract classes and inheritance): PaintSplotchApplet2.java, PaintSplotchPanel2.java, paintsplotch2.html

Examples: mouse clicks and timers: WhackAMole.java, WhackAMolePanel.java, whack-a-mole.html

Examples: keyboard and focus events: KeyDemoPanel.java, DotPanel.java, KeyDemoApplet.java, keydemo.html

   
   
   
  lab #11: Swing Components, ActionEvents, and LayoutManagers
due R 12/02 at the start of lab
 
quiz #9
due M 11/22 by class
 

Week 13: 11/22-11/26

Topics: GUI programming

Reading: 6.3-6.6, 7.4 (about animation and timers); the rest of chapter 7 is optional reading for those who are interested in more advanced GUI topics

Examples: mouse drags: DragAMoleDemo.java, DragAMolePanelDemo.java, drag-a-mole.html

Examples: mouse clicks and a Swing- and applet-compatible version of Mosaic: MosaicCanvasDemo.java, MosaicCanvasX.java, demo.html

 
   
  Thanksgiving recess
W 11/24 - S 11/28
 
 

Week 14: 11/29-12/3

Topics: arrays and ArrayLists

Reading: 8.1-8.3

Examples: ways to use arrays: Reverser.java, Magic8Ball.java (possible responses picked from commandline), Magic8Ball2.java (possible responses hardcoded), DiceCount3.java

Examples: arrays as parameters: ArrayParamDemo.java

Examples: partially-full arrays: HandWithArray.java

Examples: ArrayList: HandWithArrayList.java

   
   
   
  lab #12: Fun With Arrays
due R 12/9 at the start of lab
 
   

Week 15: 12/6-12/10

Topics: searching and sorting arrays, multi-dimensional arrays

Reading: 8.4-8.5

Examples: TicTacToe.java (2D arrays)

Examples: searching and sorting: HandWithArray.java, Searching.java

quiz #10
due W 12/8 by class
 
 
   
  in lab: work on final project  
     

Week 16: 12/13-12/17

review session
M 12/13 6pm
review topics
     
final exam
T 12/14 8:30-11:30am
     
       
       
       

Valid HTML 4.01!