CPS 202 – Computer Programming II

Fall 2009

Dr. Close

 

ASSIGNMENTS

(Rev. 22-Sep-2009)

 

Instructions:  This document is tentative.  Students are responsible for checking the course Moodle or my Web site for updates.  Complete all assignments shown prior to that day’s lecture. 

 

Lecture

Date

Topics

Readings and Assignments

Lecture 1

Aug. 25

Introduction; MyCodeMate Basics; Java Code Conventions

 

·        This course requires a Heidelberg e-mail account.  If you do not have an account, submit a request to the CNIT Helpdesk in the Bareis computer lab no later than 4 PM today.

Lecture 2

Aug. 27

Review:  classes, variables, parameters, public and private modifiers, assert, UML, encapsulation, constructors, initializing fields, setters and getters, etc.

·        Enroll in the course Moodle.

·        Use the MyCodeMate Access Code included with your textbook to create a MyCodeMate account at http://www.mycodemate.com.  If you bought a used textbook, you will need to purchase a license from MyCodeMate. 

·        Read Savitch, “Preface for Students;” Ch. 4, Defining Classes I, Section 4.1 (“Class Definitions”), 4.2 (“Information Hiding and Encapsulation”), 4.3 (“Overloading”), and 4.4 (“Constructors”).

·        Homework:  Complete Programming Project #2, Ch. 3, p. 162 , using MyCodeMate.

·        Homework:  View the Ch. 3 PowerPoint show as a Java control structures refresher as needed.  Do all Self-Test Exercises in today’s readings; view the Ch. 4 PowerPoint slideshow; take the Ch. 4 Quiz on MyCodeMate.

·        Graded Homework #1 (≈ 2%):  Create a folder on your M drive for CPS 202.  Open NetBeans, create a new project in that folder called “Craps.”  Copy and paste your source code from MyCodeMate into a new NetBeans file, right-click the project name and select Run Project from the context menu.  Documentation:  use “Print as HTML” with line numbering turned on and print your source code from your browser.  Print a screen shot of your NetBeans output pane to document your output.

 

Lecture 3

Sept. 1

Review:  static fields and methods, references and pointers. StringTokenizer class, deep vs. shallow copies, privacy leaks, copy constructors and cloning

 

·        Read Savitch, Ch. 5, Defining Classes II, Section 5.1 (“Static Methods and Static Variables”), Section 5.2 (“References and Class Parameters”), and Section 5.3 (“Using and Misusing References”).

·        Homework: Do all Self-Test Exercises in today’s readings; view the Ch. 5 PowerPoint slideshow.

 

Lecture 4

Sept. 3

Packages, javadoc;

Review:  array basics, passing and returning arrays

·        Read Savitch, Ch. 5, Section 5.4 (“Packages and javadoc”); Ch. 6, Arrays, Sections 6.1 (“Introduction to Arrays”) and 6.2 (“Arrays and References”).

·        Homework:  Do all Self-Test Exercises in today’s readings; take Ch. 5 Quiz on MyCodeMate.

·        Programming Assignment #1 Due (≈ 5%):  p. 249, #8 (Date).  See hand-out for additional specs.

 

Lecture 5

Sept. 8

Review: references and arrays of objects; length variable; variable argument parameters,  multidimensional arrays, ragged arrays

·        Read Savitch, Ch. 6, Section 6.3 (“Programming with Arrays”), Section 6.4 (“Multidimensional Arrays”).

·        Homework:  Do all Self-Test Exercises in today’s readings; view the Ch. 6 PowerPoint slideshow and take Ch. 6 Quiz on MyCodeMate.

 

Lecture 6

Sept. 10

Time complexity and Big-O notation; sorting arrays, enumerated types;

PA2 debug

 

 

·         Reread Savitch, Ch. 6, “Sorting an Array,” pp. 382-393.

·        Graded Homework #2 (≈ 2%):   Prepare for PA2 code walk-through and debug.  Bring print-outs of source code and output to class.  You must bring print-outs to class to receive graded homework credit.  Your program does not need to be complete, however.

 

 

Lecture 7

Sept. 15

Sorting arrays,  “for-each” looping, privacy leaks in arrays; inheritance review

 

·        Read Savitch, Ch. 7, Inheritance, Section 7.1 (“Inheritance Basics”).

·        Homework:  Do all Self-Test Exercises in today’s readings.

·        Programming Assignment #2 Due (≈ 5%):  p. 413, #2 (Memory Game).  See hand-out for additional specs.

·        Homework:  Prepare for Quiz 1

 

Lecture 8

Sept. 17

Review: inheritance; overriding base class methods; covariant return types; access issues PA3 kick-off 

·        Read Savitch, Ch. 7, Section 7.2 (“Encapsulation and Inheritance”).

·        Homework:  Do all Self-Test Exercises in today’s readings.

·        Quiz #1 (5%) -- covers material through Sept. 15

 

Lecture 9

Sept. 22

Object class; “is a” vs. “has a” relationships; super, the right way to define the equals method

·        Read Savitch, Ch. 7, Section 7.3 (“Programming with Inheritance”).

·        Homework:  Do all Self-Test Exercises in today’s readings; view the Ch. 7 PowerPoint slideshow; take Ch. 7 quiz on MyCodeMate.

 

Lecture 10

Sept. 24

Polymorphism

·        Read Savitch, Ch. 8, Polymorphism and Abstract Classes, Section 8.1 (“Polymorphism”).

·        Homework:  Do selected Self-Test Exercises in today’s readings.

·        Programming Assignment #3 Due (≈ 5%):  p. 471-472, #6 (Vehicle).  See hand-out for additional specs.

 

Lecture 11

Oct. 1

Polymorphism; clone method; abstract classes; exception handling

·        Read Savitch, Ch. 8, Section 8.2 (“Abstract Classes”); Ch. 9, Exception Handling, Section 9.1 (“Exception Handling Basics”).

·        Homework:  Do all Self-Test Exercises in today’s readings; view the Ch. 8 PowerPoint slideshow.

·        Graded Homework #3 (≈ 2%):   Complete the program rewrite, p. 469-470, #3 (Alien game).  Bring print-outs of source code and output to class.  You must bring print-outs to class to receive graded homework credit.

 

Lecture 12

Oct. 6

Exceptions, continued; text files

·        Read Savitch, Ch. 9, Section 9.2 (“Throwing Exceptions in Methods”) and Section 9.3 (“More Programming Techniques for Exception Handling”); Ch. 10, File I/O, Section 10.1 (“Introduction to File I/O”) and Section 10.2 (“Text Files”).

·        Homework: Do all Self-Test Exercises in today’s readings; view the Ch. 9 PowerPoint slideshow; take Ch. 9 quiz on MyCodeMate.

·        Programming Assignment #4 Due (≈ 5%):  p. 509, #4 (Predator).  See hand-out for additional specs.

Lecture 13

Oct. 8

Midterm Exam

·        Midterm Examination (20%) -- covers material through Oct. 6.  See Moodle calendar for midterm study guide.