|
On this site you will find highlights from the CS2 Course that I taught this summer. The course featured interactivity, abstract data types, and algorithms, in roughly equal parts. Java was the programming language employed -- the primary "object to think with". The NetBeans IDE (integrated development environment) was used both to facilitate program development and to enrich the Java learning experience.
Course Summary
The following links provide a glimpse of the course. It is meant to be read in an up-tempo fashion without giving much thought to anything! Rather like a pointallist painting provides an image from its points, this sequence of slides provides an image of the course. (Apologies for the temporal transgression in the analogy!)
Course Overview, Organization, and Operation
The instructional framework is described in the syllabus . A relatively straightforward approach to teaching the course was adopted. The key ingredients were lectures, labs, programming assignments, and exams. One somewhat distinctive element of the course is that a "Question of the Day" (QoD) was incorporated. These questions would generally serve to set up discussion for the day, to review previous material, or both. There were 22 class periods. Class met from 10am to 11:45am Monday through Thursday each week, starting on May 30 (Tuesday) and ending on June 6 (Thursday), with the exception of July 4th. An office hour was be held each morning from 9am to 10am. Two operational notes were distributed along with the initial handout: a note on assignments and a note on exams .
Course Content
A second somewhat distinctive element of the course is that a very simple programming language was implemented in the guise of a sequence of programming assignments. An interest in integrative learning and a concern for content cohesion inspired this particular project-based approach to teaching the course. The tact is also consistent with the CS2 goal of helping you to grow in programming maturity from the level of writing smaller programs to the level of developing larger programs.
Interactivity was studied by means of a sequence of programs which lead to the implementation of a version of the programming language Clay. This sequence of programs was broken down into thematic subsequences. The subsequences were complemented by more or less independent programming "modules" which pertained to algorithms and data structures. The data types studied in some detail were lists, restricted lists, binary trees, and hash tables. The classic sorting algorithms studied were quicksort, heapsort and generalized radix sort.
Course Programming Assignments
The assignments gathered below were the essence of the course. The rest was "glue" which held the course together in the form of motivation, information, clarification, elaboration, evaluation, etc. The notes and charges are simply gathered from various directories. The student is the intended addressee throughout. Each "Assignment" is contextualized in a document which generally contains some or all of the following items: a specification of tasks to be performed; demos which tend to quickly portray the essentials of the programming to be performed; code which is to be used/refined/augmented; questions which often provide a basis for class discussion. (The tasks can be referenced by clicking on the opening link of the assignment page.)
Getting Started with NetBeans
The first assignment of the semester is a variant of the traditional Hello World Program. Assignment 1 is merely meant to acquaint you with a few operational aspects of NetbBeans -- just enough to be able to write Java applications in the NetBeans environment.
Clay GUI -- Basic Frame
Assignment 2 is Version 1 of the Clay Shell program. It merely creates a frame and makes it visible. The frame is titled "Clay". It is 200x400 pixels in size. Assignment 3 is Version 2 of the Clay Shell program. It is like Version 1 except that it makes the background of the frame blue. Structurally it is different in that a new class which extends the Frame class is defined and used. Assignment 4 is Version 3 of the Clay Shell program. It processes command line arguments, allowing you to specify the height and width of the frame, and permits you some control over the background color. Assignment 5 is Version 4 of the Clay Shell program is like the third version except that the frame can now be closed in the usual way!
Clay GUI -- Layout of the Land (Land = ClayFrame)
Assignment 6 is Version 5 of the Clay Shell program. It is like Version 4 except that it contains dead buttons in a border layout. Assignment 7 is Version 6 of the Clay Shell program. It is like Version 5 except that its buttons are alive! Assignment 8 is Version 7 of the Clay Shell program. It is like Version 6 except that the center Button object is replaced by a TextArea object. Assignment 9 is Version 8 of the Clay Shell program is like Version 6 except that the center region is partitioned vertically into a text area and a canvas, and the button names and functions are changed. The center region is clearly assuming the role of a "content" region. Assignment 10 is Version 9 of the Clay Shell program. It is like Version 8 except that two addtional bits of functionality are added, the button functionality is consolidated into the northern region, the east and west regions are eliminated, and a stub button is placed into the southern retion. The northern region is apparently assuming the role of a "control" region. Assignment 11 is Version 10 of the Clay Shell program. It is like Version 9 except that the button stub is replaced by a text field which is used to input commands textually. Assignment 12 is Version 11 of the Clay Shell program. It is like Version 10 except that the GUI code is significantly reorganized. Assignment 13 is Version 12 of the Clay Shell program. It is like Version 11 except that the interpreter has been "refactored".
A Bit of Graphics Programming
Three Java packages comprised of 5 Java classes, each partially specified by a Java interface, are defined. A test program is presented for each class. Three problems are posed in the form of application programs which make use of these packages. All of this is done within a ClayGraphics project. Assignment 14 implements the clay.shapes package of the ClayGraphics project. Assignment 15 implements the clay.math package of the ClayGraphics project. Assignment 16 implements the clay.canvas package of the ClayGraphics project. Assignment 17 is a graphics application program which paints a circle design. Assignment 18 is a graphics application program which paints three identical buildings. Assignment 19 is a graphics application program which paints random disks.
Augmenting Clay
Arrays are used in augmenting functionality. Also, a "layout" GUI problem is posed. Assignment 20 is Version 13 of the Clay Shell program. It is like the previous version except that button/text functionality is augmented to include a command called quote which displays a random quote. Assignment 21 is Version 14 of the Clay Shell program. It is like the previous version except that button/text functionality is augmented to include a command called word which displays a random word and its definition. Assignment 22 is Version 15 of the Clay Shell program. It is like the previous version except that sets of buttons are grouped together physically.
Command Sequences, Chunking, and Vocabularies in Clay
Assignment 23 is Version 16 of the Clay Shell program. It is like the previous version except that (1) in addition to executing commands from the text field sequences of commands can be executed from the text field, and (2) a "wait" command is implemented which suggests some interesting programming possibilities. Assignment 24 is Version 17 of the Clay Shell program. It is like the previous version except that a sequence of commands can be chunked for subsequent use. That is, a command can be defined. Assignment 25 is Version 18 of the Clay Shell program. It is like the previous version except that (1) Clay command definitions are remembered for the session in which they are defined, thus forming a new vocabulary of terms, and (2) a command is added for displaying the names of the vocabulary of terms defined in the session. Assignment 26 simply requires that you prepare to write some clay programs "on demand".
Linear List Processing
In Assignment 27 two Linear List ADTs are established in are established, a numeric linear list ADT and a string linear list ADT. Two implementations of each ADT will be addressed in subsequent assignments. For each ADT, a sequential DT is implemented and a linked DT is implemented. Assignment 28 provides a sequential implementation and a complete test program for the NumericLinearList datatype. Assignment 29 provides a sequential implementation and a complete test program for the StringLinearList datatype. Assignment 30 requires that you implement the string linear list ADT sequentially. Assignment 31 requires that you implement the numeric linear list ADT dynamically. Assignment 32 is a linear list processing application.Stacks and queues are presented as abstract data types, implemented using the Java Vector class, and used in a number of simple applications. Assignment 33 is presentes a sequential object stack ADT implementation. Applications involving stacks are featured in the next two assignments. Assignment 34 uses a stack to reverse a list. Assignment 35 uses a stack to perform postfix evaluation of an expression. In Assignment 36 a circular object queue ADT implementation is presented. Assignment 37 is a multikey sorting application of queues.
Binary Trees
In Assignment 38 binary trees are presented in terms of an ADT, an abstract class implementation, two extensions of this class, and two test programs.
Searching and Sorting
Three searching and sorting classics are presented which are algorithmically very interesting. In Assignment 39 a sequential implementation of binary trees as pseudocode for heapsort is refined. Quicksort an artful example of the "divide and conquer" problem solving strategy. Assignment 40 involves the rendering of pseudocode to perform quicksort in Java. Assignment 41 focusses on hashing, a technique which powerfully illustrates how computation can facilitate search.
Clay Persistence
Three "reading exercises" are provided to show how the current version of Clay can be transformed first to a version of Clay with persistence, then to a "refactored" persistent version of Clay, one "packaged" for subsequent use, and finally to a microworld instantiation of clay which features a fairly agile "painter". The microworld will be featured in the final programming assignment! Reading Exercise 1 examines Version 19 of the Clay Shell program and features just a little bit of file processing. Reading Exercise 2 examines Version 20 of the Clay Shell program which refactors the code in the Main file of the previous version, placing it in a package for subsequent use. Reading Exercise 3 centers on a microworld instantiation of the Clay Shell program. It illustrates specialization of packaged classes.
Clay Painter Microworld
The last assignment of the semester involves interacting with a Clay microworld. More precisely, Assignment 42 features a program which extends a variant of the Clay Shell to a Clay Painter Microworld.