CSc 221 Spring 2006

Testing.

Added 7.14.2005: The end of March is when my hip problem forced me to give up any active role in the two sections of this course. If you want to see what the course is typically like, check out http://ccnyddm.com/221Fall2005/CSc221Fall2005.htm, or see the sketch of plans for the Spring 2007 version.

Added 3.26.2005: HW5 is posted.

Added 3.26.2005: There is a crucial piece missing for doing HW4. (It's missing because I didn't cover it in class.) Within the loop that polymorphically processes the invoices and employees, you need to test whether each payableObjects is BasePlusCommissionEmployee and take appropriate action if so. One thing I omitted from lecture: how do you know what kind of an object a  particular payableObjects is? Answer: use the instanceof operator. (That's right, operator, and  instanceof is a keyword.) You will write:
if ( payableObjects[ i ] instanceof BasePlusCommissionEmployee ) {
and then take appropriate action.

Next problem: you need to downcast that current  payableObjects[ i ] to be a BasePlusCommissionEmployee, because of rules that I can't explain quickly here. Just  do this:

BasePlusCommissionEmployee currentPayable =
( BasePlusCommissionEmployee ) payableObjects[i];


Now, currentPayable can be treated as a BasePlusCommissionEmployee  object, and the latter has a getter and a setter that you can use to increment the base salary. I leave this part to you.

Many thanks to Lina Cordero for raising this issue. And for raising it soon enough to be helpful to others.

Added 3.17.2005: The requirements for HW4 are posted.

Added 3.16.2005: I've decided on HW4. Complete page tomorrow. Meantime, here's a rough sketch, followed by notes on the remaining homework as they look today, exactly half way through the semester.

Added 3.4.2005: I've provided some hints about computing J1(x).

Added 2.26.2005: There is further information on HW3, the JUnit aspect in particular, plus a more complete statement of what you are to do. This link is to the HW3 page, but at the location of the new material.

Added 2.20.2005: Thanks to Jorge Castañeda for a link to a neat tutorial on making a program into an executable JAR (Java ARchive) file. http://www.cs.laurentian.ca/badams/c1047/eclipse-tutorials/export-tutorial.html
Soon I will ask that all homeworks be submitted as JAR files. Saves misery (for me) when I get files from those of you on Yahoo.

Added 2.20.2005: There is a preliminary statement of Homework 3.

Added 2.18.2005: Sorry to have missed three classes. I would FAR rather have been in the classroom with you than in the hospital!

Here is a sketch of the next couple of weeks.

Added 2.6.2005: A preliminary statement of HW2 is posted.

Added 2.5.2005: The due date of HW1 is changed to Thursday, Feb 9. It's a little harder than I thought, teams have changed a lot, and some people just need more time. It is important that everybody succeed at this.

Also added 1.27.2005: Homework 1 is now posted. Each homework gets its own page here.

Added 1.27.2005: Here is a link to the Eclipse tutorial, which also gets you started on homework 1. Thanks to Philip Radin for pointing out the absence of a link on this  page. (There is one  on the  home page.)

Either today (Jan 27) or tomorrow, I will post HW1 here, and you will have a paper copy in class on Tuesday. The Eclipse tutorial contains the heart of it,  although there are some details missing. The homework is due before the start of class Tuesday, Feb 7. You submit homework as an attachment to email, sending me just the source code, as a .java file. Later we'll learn how to package homework into something called a JAR file (Java ARchive), which has advantages.

Subsite under development. In meantime, you can get an idea of what the course is about by looking at the Fall, 2005, subsite.

Resources. A page with various useful information, often links to good tutorials.

Tentative Syllabus, January 8,2006--subject to change

CSc 221 Software Design Laboratory

Prof. McCracken

 Section 221L: Tuesday and Thursday: 9:30-10:45 in NAC 6/310.

Section 221R: Tuesday and Thursday: 3:30-4:45 in NAC 6/311.

Prerequisite: CSc 212, Data Structures, or equivalent elsewhere.

Office: NAC 8/202E Office hours 11-12 Tu&Th and before/after class.

Email: mccracken@cs.ccny.cuny.edu or ccnyddm@aol.com

Website: ccnyddm.com check for news, homeworks, etc.

Text: Deitel and Deitel, Java How to Program, Sixth edition, Prentice Hall, 2005.

The purposes of the course:

·        To help you develop considerable proficiency in Java. We have a good text and I trust the lectures will help, but you will learn programming by doing it. You will be working on some kind of programming assignment at all times except exam days.

·        To help you develop a reasonably full understanding of object-oriented programming: what it is, why it is important, and how to do it.

·        To extend your command of what is meant by program design.

·        To introduce you to the Java approach to compilation and execution, which involves the Java Virtual Machine executing bytecode. This is the heart of Sun’s slogan, “Write Once Run Anywhere.” We will see how this applies to code in everything from Enterprise computing (mainframes, which are definitely not dead) to the software that runs radios, car engines, anti-lock brakes, and a great many other things. It is the heart of IBM’s strategy for developing Web-based applications, using Java, Linux, and the DB2 (or any other) database system. (It is quite impossible to cover the entire Java language, with its 3500 classes, in 14 weeks. But you'll get a good grounding for further study, either in later classes or on your own.)

One of this text’s outstanding features is that all code examples are complete programs, and the programs are on the book’s CD as well as available directly from Deitel.com. I will be using these examples in many/most lectures. I don’t know how it will be possible to pass the course without a textbook. There are copies on reserve in the Science Library. Check Barnes & Nobel and Amazon for used copies.

There are significant differences between the fifth and sixth editions. The course CD contains a spreadsheet showing the approximate chapter match-ups.

I will provide each of you with a CD containing lots of useful material. We need to get off to a fast start, and time wasted finding stuff that I can easily provide you is an unacceptable waste of your time and of course time.

We will review the basic ideas of object-oriented programming (OOP). You should have seen encapsulation and inheritance, but probably not the third leg of OOP, polymorphism. We will study graphical user interfaces (GUIs) in some detail, although it will be impossible to cover more than a fraction of the power that Java provides. You will get enough experience with GUI development to learn the rest of the subject on your own; we need time to focus on things that are not so easily learned by oneself.

We will explore some of the advanced features of Java, things needed for any serious computing: regular expressions, collections (sets, map, and lists); threads; generics; serialization; and accessing databases with JDBC. 

We will explore some of the ideas of the widely-accepted practices of Extreme Programming. One key feature is that most if not all projects will be done in teams of two people, who will work at one computer whenever possible: one person types, the other proofreads and makes suggestions. The two trade places regularly. I will form the teams, at least for the first half or more of the course. The preparation of a test plan is another key idea from Extreme Programming. Ideally, a testing program automatically runs your program against your test data. We will do that in two early assignments. Carried further, this goes by the name of design by testing.

There will be two midterms and a major project, but no final.

I love email. Talk to me: ccnyddm@aol.com, or mail to mccracken@cs.ccny.cuny.edu will be forwarded there. I check my mail many times a day, usually. I can’t promise instant response on all occasions, but I try.

Tentative grading, subject to change depending on how we do the project:

·        Homeworks: 25%

·        Quizzes (about 5): 20%

·        Midterm I: 15%

·        Midterm II: 20%

·        Final project, which will have several separately-graded deliverables: 20%.

In computing your course grade I discard your lowest homework and your lowest quiz.

This is one of my favorite courses. I designed it and introduced it, and have taught it probably 20 times. I never get tired of it, in large part because it’s always changing. I take great delight in showing people student projects, which are highly educational and satisfying to all. The switch to Java has certainly made the course more interesting for me, and now that Java is the world’s most widely used programming language, Java is really the only reasonable choice for the course.

NOTE: We will be using Java 1.5, sometimes also called Java 5. It has some neat features, and some of these are used in the sixth edition of the text. The course CD contains JDK 1.5 for Windows. If you have a Mac or are running Linux, a version for your system can readily be downloaded.

We will be using two IDEs (Integrated Development Environment): JCreator and Eclipse. JCreator Learning Edition is a free download. JCreator and Eclipse are on the course CD. You will see why we want both. If you have any reason to download Eclipse, which is free, be sure to get Eclipse 3.2. But it is on the course CD. ** Well, 3.1 or 3.2? The Eclipse site says that 3.1 is the "last stable build." I've been using 3.2 for several months, and I wouldn't know what's unstable about it. Maybe I don't know what the term means, exactly.

Sketch of the homeworks: SUBJECT TO CHANGE. This is the list from Fall 2005; there will be at least a few changes. In fact, there may be a lot of changes.

·        HW 1 and 2: Modification and extension of a program with a Graphical User Interface (GUI). Regular expressions. Exception handling with try/catch blocks.

·        HW 3: Computation of the sine, cosine, hyperbolic sine, and hyperbolic sine, from their Taylor series. A test program, in JUnit, is to be written first.

·        HW 4: Building a Complex class, then using it to demonstrate that sin2x + cos2x = 1 holds for complex numbers. Maybe some teams will demonstrate numerically the beautiful Euler’s identity, e i π + 1 = 0.

 

Changed my mind on HW4. We've done enough math for this semester, and you need to know inheritance and polymorphism. HW4 will be some variation of Exercises 10.11 and 10.12 of the sixth edition of the textbook. Details Friday, March 17. Meanwhile, be studying Chapter 9 and 10 of the text. NOTE: IGNORE ALL THE FORMATTED OUTPUT STUFF. This would be incredibly important in many applications. It doesn't fit in this course.

·        HW 5: The Model/View/Controller design pattern; building a GUI to display temperature. THIS WE WILL DO. Very important concepts, and you get to show your creativity in building a GUI to display a temperature.

 

·        HW 6: Java Collections, with probable focus on the HashMap or HashSet. These require overriding the equals() and hashCode() methods of the Object class, the top of the class inheritance tree. NOT SURE WHAT WE'LL DO HERE. Something like this, maybe.

·        HW 7: Collections used with threads and serialization. NO WAY we can do two more homeworks after the MVC stuff in HW5, and have adequate time for the final project. I'll pick something, I hope along the lines of the HW7 here. Stay tuned.

·        HW 6: Details to be announced, but I'm going to dream up something that uses collections and threads.

HW 87 = Final Project: A database of books (or something), using MySQL and the Java Database Connectivity (JDBC) functions. THIS IS FOR SURE, although the application area remains to be seen.

 

A lot of work? Of course. How else can you learn? (You can't learn to play the piano in a lecture course.) It’s going to be the best 221 ever!

 Back to Dan McCracken's  Home Page