The syllabus for this course is here.
We will be using the Java SE edition of the NetBeans development environment in this course. The version of NetBeans installed in the lab is 6.1, which is also the version that I will be using for demonstrations in class. If you would like to install NetBeans on your own computer, the latest version of the NetBeans software for Windows, Mac, and Linux is available as a free download.
Documentation on classes in the Java class library is available through this link. The easiest way to navigate through this documentation is by packages. Some of the more useful packages include java.lang (String, Math, Integer, and Double classes), java.util (StringTokenizer, Random), java.awt (Graphics), and javax.swing (all of the user interface classes).
Lecture notes for the introductory lecture. Reading for Friday is Chapter 2.
Chapter 3, decision structures: lecture notes. Here is a zip file containing a NetBeans project with the source files for today's examples. The lecture notes end with a couple of short exercises for you to try on your own. I will show solutions on Monday.
I showed solutions to problem 1 and problem 2 from the end of Friday's lecture notes. The main topic today is Chapter 4, repetition structures.
This week's lab contains five short exercises in loop writing. All five of these programs are due as homework on Friday. To submit your homework, put all five programs in a single project, place the project folder in a zip file and send me that file.
I began the discussion of Chapter 5, Methods. Here are lecture notes covering the basics of methods, and the project containing all the examples discussed in the lecture notes.
I showed my solutions to the suggested problems from chapter 5. Those solutions make use of the System.out.printf method - you can read more about that in section 3.6 of the text.
We looked at two examples of programs that combine loops with methods to solve significant problems: a program to do date arithmetic and the program from section 5.11 that prints a calendar for any month. The latter example is particularly significant as a good example of how to use methods to decompose a complex problem into smaller, more managable pieces with methods. You should read section 5.11 and study this example carefully. The next programming assignment is programming exercise 5.29 on pages 176-177 of the text, due on Friday.
This week's lab exercise is also due as homework on Friday.
I began the discussion of chapter 6, arrays, by showing some basic examples that mostly came from the text. Reading is sections 6.1 through 6.4 in the text.
More examples of applications of arrays.
This week's lab exercise is also due as homework on Friday.
I discussed two sorting algorithms, insertion sort and counting sort. I developed the code for insertion sort and described how counting sort works. I left the work of implementing counting sort as a programming exercise for you to do - that exercise is due on Wednesday, April 29.
In addition to those two algorithms, I also showed the binary search algorithm.
Selection sort, insertion sort, and binary search are all discussed in sections 6.7 and 6.8 in the text. You should read those two sections.
I wrapped up chapter six by covering some remaining ideas related to arrays: array initializers (section 6.2.5) and two-dimensional arrays (section 6.10). I showed the FindNearestPoint.java example from section 6.10.6 and used that as motivation to introduce objects via a point class. Here are lecture notes and a project containing all of today's examples.
This week's lab exercise is practice for the midterm coming up on Friday.
The first midterm exam is coming up on Friday. This exam will cover chapters 2 through 6 and will focus mostly on writing and using methods, loops, and arrays. The exam will be closed book, but you will be allowed to bring a single page of notes (front and back) to the exam.
Chapter Seven, Objects and Classes. I showed the Circle class example from Chapter Seven, and a more complex example of a program that uses a class to play a number-guessing game. Here are lecture notes on that example.
This week's lab exercise is due as homework by Monday, May 11.
Chapter 8 - Strings and Files. Here are lecture notes and the source code for today's examples. The lecture notes contain a short programming assignment that is due on Friday.
This week's lab exercise contains a short programing assignment due on Friday.
I showed an extended example in class to demonstrate how to design and implement a class with complex internal state. That class is a BigInt class that is used to represent and manipulate arbitrarily large positive integers.
The BigInt class I wrote on Friday includes an add method for adding two BigInts and a main method that tests the add method. Write a multiply method for the BigInt class and rewrite the main method to test your multiply method in a meaningful way. This assignment is due on Wednesday, May 20.
I talked about inheritance, generic container classes, and template container classes. This material is spread across several sections in the text. Specifically, you should read sections 10.2, 10.4-10.10, and 21.2.
This week's lab exercise is practice for the midterm coming up on Friday.
This week's lab exercise completes the material on graphical user interfaces. No work is due from this lab; instead, you will need to know this material to complete the final assignment.
The last assignment of the term is to build a text editor with a spell checker. Here is a project containing code you can use as a starting point. This assignment is due on Friday, June 5.
Interfaces - reading is sections 11.2, 11.4, and 11.5
The final exam will be at 8:30 on Monday morning. Here is a list of topics to review for the final exam. In class I showed an example showing three ways to solve a moderately complex problem - determining which integer in an array of integers appears most often.