CPSC 124 Introduction to Programming Spring 2005

CPSC 124 Syllabus

 Assignments

Week 1: 1/17-1/21

Topics: overview and introduction, structure of a basic Java application, variables, primitive types, strings, text input and output

Reading: 1.1-1.7, 2.1-2.3, 2.4-2.5
Plan to do the readings before coming to class, so that class time can be spent on addressing questions and trickier topics.

Examples: Eliza0.java (basic program structure, output), Eliza1.java (variables, TextIO), Average.java (TextIO, integer vs. double division)

     
     
     
  lab #1: Introduction to Linux and Java
due R 1/27 at the start of lab
 
   

Week 2: 1/24-1/28

Topics: String and Math, algorithm design, conditionals

Reading: 2.3, 3.1-3.2, 3.5-3.6

Examples: MathStringDemo.java (using Math and String), rules for risk (top-down design - overview, then refine with details), Calculate1a.java, Calculate1b.java (two versions of the simple calculator problem)

Jeliot information (program animation)

   
   
   
  lab #2: Math, String, and TextIO (Oh My!)
due R 2/3 at the start of lab
 
   

Week 3: 1/31-2/4

Topics: loops

Reading: 3.3-3.4

Examples: Folding.java (while loops), Max.java and Max3.java (finding maximums), PrintNums.java (fencepost problems), DiceCount1.java (random integers, while loops), DiceCount2.java (for loops)

Max2.java is an advanced version of the maximum-finding program, where the user can enter "quit" instead of a number to quit - this is provided as an example for the curious, but it uses things that are beyond the scope of this course

   
   
   
  lab #3: Conditionals, Loops, and Simulation
due R 2/10 at the start of lab
(TempConvert.java)
 
   

Week 4: 2/7-2/11

Topics: loops; subroutines, parameters, return values

Reading: 3.3-3.4; 4.1-4.4

Examples: MultTable.java (nested loops), Beer0.java (subroutines), Beer1.java, Beer2.java (subroutines with parameters)

   
   
   
  lab #4: More Fun With Loops
due R 2/17 at the start of lab
 
   

Week 5: 2/14-2/18

Topics: subroutines, parameters, return values; review

Reading: 4.1-4.4

Examples: RollSum.java (parameters and return values), DiceCount3.java (switch), StringCap0.java, StringCap1.java (functions, string manipulations)

exam review information

   
   
   
  lab #5: Functions
due R 2/24 at the start of lab
 
review for exam
(in class F 2/18)
 

Week 6: 2/21-2/25

Topics: exam; top-down design with subroutines, constants

Reading: 4.6-4.7

Examples: MathQuiz.java (design with subroutines)

exam #1
M 2/21
(solutions)
programming assignment #1: Eliza
due R 3/10 5pm
(before you leave for spring break)
 
 
  lab #6: Mosaic and Animation
due R 3/3 at the start of lab
(StickFigure.java - animation example)
 

Week 7: 2/28-3/4

Topics: classes and objects

Reading: 5.1-5.2

Examples: War.java (using classes and objects), Student2.java (a small class, constructors, public vs. private), StudentDemo.java (demo of using Student2)

 
 
 
  lab #7: Using Objects
due R 3/10 at the start of lab
 

Week 8: 3/7-3/11

Topics: classes and objects, object oriented design

Reading: 5.1-5.3

Examples: Dice.java (writing a class, static vs. non-static), DiceTester.java (using objects, static vs. non-static), CyberPet.java (writing a class), CyberPetDemo.java (using objects)

 
 
 
  in lab: work on project
spring break
3/11-3/20

Spring Break


Week 9: 3/21-3/25

Topics: arrays

Reading: 8.1-8.2, 8.5

Examples: ArrayDemo.java (arrays as function parameters, array assignment), ArrayDemo2.java (arrays of objects), CommandLineDemo.java (commandline arguments), ArrayDemo3.java (2D arrays), TicTacToe.java (main program), TicTacToePlayer.java, (tic-tac-toe player - example of classes), TicTacToeBoard.java (tic-tac-toe board - 2D arrays)

    programming assignment #2: Snake Pit
due W 4/6 5pm
   
   
  lab #8: Pong
due R 3/31 at the start of lab
 

Week 10: 3/28-4/1

Topics: introduction to applets and graphics, toolboxes, APIs, packages; review for exam

Reading: 4.5, 6.1-6.3

Examples: BasicApplet.java (basic Swing applet), BasicComponent.java (basic Swing component), basicapplet.html (web page for running BasicApplet), BullseyeApplet.java, BullseyeComponent.java (components with constructors and instance variables), bullseyeapplet.html

exam review information

 
 
 
  lab #9: Arrays
due R 4/7 at the start of lab
 

Week 11: 4/4-4/8

Topics: exam; layout managers and events

Reading: 6.1, 6.3-6.6

Examples: LayoutDemoApplet.java, layoutdemo.html, BorderLayoutDemoApplet.java, borderlayoutdemo.html, ComplexLayoutDemoApplet.java, complexlayoutdemo.html (layout managers), ButtonDemoApplet.java, buttondemo.html (event handling - applet class handles), ButtonDemoApplet2.java, buttondemo2.html (event handling - nested class handles), ButtonDemoApplet3.java, buttondemo3.html (enabling/disabling components)

exam #2
M 4/4
(solutions)
 
 
  lab #10: Sampler Quilt
due R 4/14 at the start of lab
final project specifications
due M 4/11 in class
 

Week 12: 4/11-4/15

Topics: events

Reading: 6.4-6.5

Examples: PaintSplotchApplet.java, PaintSplotchPanel.java, paintsplotch.html (mouse and mouse motion events), WanderingDotApplet.java, WanderingDotComponent.java, wanderingdot.html (mouse motion events), ClickDemoApplet.java, ClickDemoPanel.java, clickdemo.html (determining mouse buttons and modifier keys on mouse events, and event timestamps), KeyDemoApplet.java, KeyDemoPanel.java, DotPanel.java, keydemo.html (key and focus events), WhackAMole.java, WhackAMolePanel.java, whack-a-mole.html (timer and mouse events)

  final project design
due M 4/18 in class
 
 
  lab #11: Talk Like a Pirate
due R 4/21 at the start of lab
 

Week 13: 4/18-4/22

Topics: inheritance & polymorphism

Reading: 5.4-5.6

Examples: Shape.java, Rectangle.java, RoundedRectangle.java, Oval.java, Circle.java (defining classes using inheritance), ShapeDemoApplet.java, shapedemoapplet.html (inheritance and polymorphism), PaintSplotchApplet2.java, PaintSplotchPanel2.java, paintsplotch2.html (inheritance and polymorphism), TicTacToe2.java, TicTacToePlayer2.java, TicTacToeBoard.java, HumanPlayer.java, ComputerPlayer.java (inheritance and polymorphism, abstract classes)

  final project
due T 5/3 5pm
 
 
  lab #12: Rabbit Hunt
due R 4/28 at the start of lab
no class
F 4/22

Week 14: 4/25-4/29

Topics: more about arrays: dynamic arrays, searching, sorting

Reading: 8.3-8.4

Examples: Hand.java (partially full array, dynamic arrays, sorting, shuffling)

 
 
 
  in lab: work on final project
   

Week 15: 5/2-5/6

Topics: arrays: searching, ArrayList/Vector

Reading: 8.3-8.4

Examples: Hand.java (partially full array, dynamic arrays, sorting, shuffling), Hand2.java (using ArrayList)

   
   
     
     
review session
F 5/6 11:15am
   

Final Exams: 5/7-5/10

exam review information

     
final exam
S 5/8 7-10pm
   
     
     

Valid HTML 4.01!