Lecture 26. Dec 01(Thursday) Conclusion.

Lab 13 Conclusion. The TAs and consultants will be in the lab, but there is no required lab. Feel free to ask them questions and to work on any assignments that are still due.  

Lecture 25. Nov 29 (Tuesday) Matlab 4. Given by Graeme Bailey.

 

Thanksgiving.

No Lab.

Lecture 24. Nov 22 (Tuesday) Matlab 3. Given by Graeme Bailey.

 

Lecture 23. Nov 17 (Thursday) Matlab 2. Given by Graeme Bailey.

Lab 12 Matlab. This lab leads you through some exercises to gain awareness of how to use Matlab.   rtf    pdf

Lecture 22. Nov 15 (Tuesday) Matlab 1. Given by Graeme Bailey.

 

Lecture 21. Nov 10 (Thursday) Exceptions. There is no handout for this lecture. We spent some time talking about assignment A6. We talked a bit about placement of components in a GUI --into a JFrame, JPanel, and Box. This kind of this will be on prelim 3. The main part of the lecture was the handling of "exceptions" in Java. This material will not be tested. However, it helps to know this material. The easiest way to learn this material is to read pages 10-1 to 1-5 in the ProgramLive CD. Of course, listen to the 3-4-minute lectures on those pages.

Lab 11 Timing execution. We show you how to time execution of a program segment. As you do this, you will compare linear serach with binary search and selection sort with insertion sort.    html     pdf   Sorting  TestingArrays

Lecture 20. Nov 08 (Tuesday) Applications. We look at Java applications (stand-alone programs) and show you how to create a jar file for one. We look at Java applets and show you how they are contructed.    powerpoint   pdf   

 

Lecture 19. Nov 03 (Thursday) No class. This lecture is canceled. Instead, please do the exercise given by the following link. It is about the development of loops that deal with arrays from invariants.   rtf    pdf

Lab 10 Locales. We show you how to format numbers, currencies, and percentages in the format prescribed by other countries. A "locale" is a country together with a language. The Java API comes with about 144 locales already defined.   html    pdf    JLiveWindow.java    MyJLiveWindow.java

Lecture 18. Nov 01 (Tuesday) Recursion. This material will not be on a test. We introduce you to the notion of a recursive method. We develop some simple recursive methods to show you how simple recursive methods can be. We do Quicksort --which replies on the previous partition algorithm. And we show you Hilbert's mind-boggling space-filling curve. File Demo.java contains all the recursive methods developed in this lecture.    powerpoint    pdf    Turtle.java    Demo.java

Lecture 17. Oct 27 (Thursday) Rectangular arrays. We look at two-dimensional arrays. We also show you how such arrays are implemented, and we see that they need not be rectangular but can be "ragged". Study Section 9.3.1 of the text.    powerpoint    pdf

Lab 09 Reading from files. We show you how to read from files. Please study the relevant material from the text and listen to the few relevant lectures on the CD.   html    pdf     Lab09.java    test.txt

Lecture 16. Oct 25 (Tuesday) GUIs: placement of components. We look at the hierarchy of components (buttons, tex fields, panels, etc.) in GUIS in the java.awt and javax.swing packages. We show how to place components in a JFrame (using a BorderLayout manager), a JPanel (FlowLayout), and Box (BoxLayout). Chapter 17 of the ProgramLive CD tells you all about GUIs in a way that the static text cannot. You will see short lectures on placing the various kinds of components for almost all components. Please look at these lectures on the CD.     powerpoint    pdf


Lecture 15. Oct 20 (Thursday) More array algorithms. We look at linear search, binary search, partitioning an array, and sorting. The slides are few because all these algorithms are in the text. See Section 8.5.     powerpoint    pdf

Lab 08 Abstract classes. Abstract classes. There are situations where we don't want a user to create instances of a class. And there are situations where we want to force a subclass to declare a method. Abstract classes and abstract methods give us the ability to do this. html   pdf    
DemoShapes.java     Shape.java     Parallelogram.java     Rhombus.java     Square.java

Lecture 14. Oct 18 (Tuesday) Array algorithms. We develop some algorithms that manipulate arrays. The emphasis is not on the finished product but the ideas involved in developing the algorithms. powerpt file   pdf file


Lecture 13. Oct 13 (Thursday) The Array. We introduce the array. An array is an object that contains a fixed amount of values, all of which have the same type. powerpt file   pdf file

Lab 07. Work on assertions and the development of loops.    pdf    word doc      Lab07.java

Lecture . Oct 11 (Tuesday). Fall Break.


Lecture 12. Oct 06 (Thursday). For loops. We show that the for loop is a special kind of while loop in which there is a "counter" and in which all bookkeeping to start, stop, and increment the counter is in one place. powerpt file   pdf file
The following pdf file contains slides for a review session on frames for method calls. Frames.pdf

Lab 06. Introduces you to class Vector, an instance of which is a changeable list of Objects.    pdf    html     Lab06.java

Lecture 11. Oct 04 (Tuesday). While loops.We continue to discuss the development of while loops. powerpt file   pdf file


Lecture 10. Sep 29 (Thursday). While loops. We start discussing loops, beginning with the while loop.      powerpt       pdf

Lab 05. Introduces you to wrapper classes (briefly) and to random number generation .  pdf    html    GuessMyNumber.java

Lecture 09. Sep 27 (Tuesday). Casting about. We look casting along the sub-class super-class hierachy and what it means. powerpt file   pdf file


Lecture 08. Sep 22 (Thursday). We looked at come miscellaneous points about classes: inheritance and overriding, function toString, super and this, using more constructor and calling another constructor using this, using super in a constructor to initialize the fields defined in the superclass, and method equals in class Object. The pages in the text that correspond to these points are given in the lecture slide. We also looked at how Edgar Allen Poe said that he wrote the poem"The Raven" --he used stepwise refinement. See the last page of Chapter 2 of the CD for that lecture.   pdf   powerpoint

Lab 04. Write functions that deal with Strings.  pdf    html  methods.java

Lecture 07. Sep 20 (Tuesday). this and super; developing methods
We look at the inside-out rule used in programming languages to describe what names a construct can use. We discuss the use of Java keywords this and that. Finally, we develop an algorithm and talk about "stepwise" refinement. powerpt file    pdf file

 

Lecture 06. Sep 15 (Thursday). Methods and method calls.
We begin a discussion of methods. We talk about the if-statement and if-else statement, the return statement in procedures, and local variables of a method. We show how to execute a method call using a frame for the call. Study chapter 2(except for section 2.3.8. for this series of lecturese on methods and method call. This material calls for practice on your part. Do as many of the exercises beginning on page 100 as you can. powerpt file   pdf file

Lab 03. Practice with JUnit, test cases, and static variables and methods.
In this lab, you will create Java class definitions (which are subclasses of JFrame).   html    pdf

Lecture 05. Sep 13 (Tuesday). Test cases, JUnit, static variables, and preconditions.
We show you how to save test cases (used to test your program) using JUnit in DrJava. It is important that you gain facility with generating test cases and saving them so that you can effectively and efficiently debug your programs. We also look at static variables and methods. Finally, we define what we mean by a "precondition" of a method. powerpt file   pdf file

 

Lecture 04. Sep 08 (Thursday). The class definition (continued)
We look at (1) class Objecet, the superest class of them all, (2) method toString, to be given in most classses, (3) fields and getter/setter methods for them, and (4) constructors.   powerpoint   pdf
There will be a quiz on Tuesday, 13 September. The website says what it will cover.

Lab 02. Practice with class definitions.
In this lab, you will create Java class definitions (which are subclasses of JFrame).   html    pdf

Lecture 03. Sep 06 (Tuesday). The class definition .
We look at the definition of a class. Each class is in its own file, with extension .java. PLEASE BE SURE THAT YOUR OPERATING SYSTEM IS FIXED THAT EXTENSIONS ARE SHOWN! This material is in Section 1.4.1 of Gries and Gries. Be sure to study the syntax of the subclass definition and the procedure definition. These are on the top of pages 42--43. powerpt file   pdf file

 

Lecture 02. Sep 01 (Thursday). Objects
We define what an object (manilla folder) is and demo the creation and manipulation of objects in DrJava. This material, in Sect. 1.3 of the text, is the basis for the enxt lecture, so study the material and practice using DrJava. pdf file ppt file

Lab 01. Java expressions.
This lab gave you practice with Java expressions using the DrJava Interactions pane. pdf file html file

Lecture 01. August 30 (Tuesday). Java expressions.
We discussed evaluating Java expressions, as discussed in Secs. 1.1 and 1.2 of the text. We covered types boolean and String. By the end of next Tuesday's lecture, you should have read these sections and looked at related activities in the CD ProgramLive.

 

Lecture 00. August 25 (Thursday). Java expressions.
After an introduction by Graeme Bailey and David Gries, we discussed evaluating Java expressions, as discussed in Secs. 1.1 and 1.2 of the text. By the end of next Tuesday's lecture, you should have read these sections and looked at related activities in the CD ProgramLive.