T-Th 9:05
or
T-Th 11:15
in Phillips 101

CS 1110: Introduction to Computing Using Java

Spring 2012

Lecture Summaries

This page lists a summary of the activities of each week, in reverse chronological order. This is your go-to page for downloading in-class handouts and getting caught back up when you get behind. This page is updated dynamically all semester long, with new material added as we get there.

If you want to see what future lectures in this class will be, you should look at the syllabus page.


Week 15


Week 14

3 May (Thursday): Conclusion

[Handout]      [Presentation]

If you have enjoyed this class, hopefully you are thinking about taking other courses in the computer science department. In this lecture, we give a quick survey of the type of higher level courses available, and what you need to do in order to take those classes.



Lab 14: Finishing Up



There are no labs held this week, but lab hours are open. Take advantage of this time to finish the lab from last week, or just get help from the consultants. You can even talk with the consultants about Assignment A7 in this lab.


1 May (Tuesday): Moving Beyond DrJava

[Handout]      [Presentation]
Demos
Simple.java
TemperatureConverter
temperature.mf


DrJava has been useful, but it is a bit of a crutch. It is also not ideal for making complex Java applications, particularly GUI applications. Today we present several alternative ways for creating and compiling Java applications. We also talk about JAR files, and how you can make a double-clickable Java application.



Week 13

26 April (Thursday): Interfaces

[Handout]      [Presentation]
Demos
MultiDimensional.java
Interface Examples


Today we talk about interfaces, which are like classes except that all methods are abstract. Interfaces are very useful as an apparent type, when we want to generalize functionality across multiple data types. We have already seen this with GUI listeners. In class today, we demonstrate this with sorting and the Comparable interface.

Reading: Chapter 12



Lab 13: Formatting Locales

[Instructions]

The goal of this lab is to introduce you to the concept of writing a listener to a GUI application. In addition, you will get some experience with "localization", how to customise an application to different cultures. This matters when you are writing to a larger user base.

This is the last official lab in this course.


24 April (Tuesday): Multidimensional Arrays

[Handout]      [Presentation]
Demos
MultiDimensional.java


Today we talk about multidimensional arrays: array that use more than one index. In essence you have already seen something like an multidimensional array with ImageArray in Assignment A6. In this class we go into more detail about how these work in Java. This topic is the last official new material for the final.

Reading: Chapter 9



Week 12

19 April (Thursday): GUI Listeners

[Handout]      [Presentation]
Demos
GUI Examples
TemperatureConverter


Today we present the interesting part of GUIs: how do you get them to do something. While none of this material will be on the exam, it is an important part of Assignment A7. Indeed, it is integral to creating any piece of software that uses a GUI.

Reading: Section 17.4



Lab 12: Timing Performance

[Instructions]

The goal of this lab is to show you how to time execution of a program and, with this new skill, to investigate the difference in execution time between linear search and binary search, between selection sort and insertion sort, and between insertion sort and quicksort.


17 April (Tuesday): GUI Layout

[Handout]      [Presentation]
Demos
GUI Examples
TemperatureConverter


As we mentioned in the previous lecture, today we come to the "view" portion of the course. We talk about how to design GUIs and lay them out visually on the screen. We do not yet talk about how to make the GUI do anything (which is for the "controller", anyway); that will be for next lecture.

Reading: Sections 17.1-17.3



Week 11

12 April (Thursday): Interlude: OO Design

[Handout]      [Presentation]
Demos
Software Patterns
IOStreams.java
TemperatureConverter


Today we step back with another big picture lecture. How do we go from a class where the instructor tells us exactly what to do, to the real world of programming? We discuss the concepts of software patterns and application architecture, and how you would use this to guide your programming.



Lab 11: Loops and Invariants

[Instructions]

The purpose of this lab is to give you practice with developing loops from invariants. It also introduces some of the important array algorithms that you should know.


10 April (Tuesday): Seaching and Sorting

[Handout]      [Presentation]
Demos
Algorithms.java


Today's lecture completes our discussion of array algorithms with the topic of sorting. Sorting is a major topic in computer science, and is fundamental to everything from web search to online business transactions. We do not expect you to be able to write your own sorting algorithms when we are done, but we do want you to have some exposure to the more popular algorithms.

Reading: Sections 8.3 - 8.5, 15.4



Week 10

5 April (Thursday): Array Algorithm Design

[Handout]      [Presentation]
Demos
Algorithms.java


Today we back up a bit and cover the material that we started to talk about at the end of class on Tuesday (and which forced the last minute change in lab). We discuss the relationship between arrays and invariants, and how we set up more interesting algorithms with arrays. This material is the last new material on the second prelim.

Reading: Sections 8.1-8.3



Lab 10: File I/O

[Instructions]

This lab discusses input (e.g. reading a file). After the lab, study section 5.9 of the text. Better yet, listen to the lectures on lesson page 5-7 of the ProgramLive CD. The lectures are much clearer than the paper version.


3 April (Tuesday): Arrays

[Handout]      [Presentation]
Demos
ArrayDemo.java


Today we present the concept of an array, which is much like a Vector except that it can contain primitive types as well. Arrays are a standard data-type found in all languages and will be an important part of the last assignments that we work on in this class.

Reading: Sections 8.1-8.3



Week 9

29 March (Thursday): While-Loops

[Handout]      [Presentation]
Demos
Demo.java
DemoTester.java


Today is a guest lecture by David Gries who has taught this class in the past. He will talk about while-loops, finishing the section on loops. While loops are the last major control structure in this class, and will open up opportunities for very powerful programs.

Reading: Chapter 7



Lab 9: Loop Exercises

[Instructions]

The purpose of this lab is to give you some practice with assertions and with loops that process a range of integers. It is a mixture of coding exercises and answers to be written on paper.


27 March (Tuesday): Loop Design and Testing

[Handout]      [Presentation]

Today we talk about loop invariants and how we use them to solve problems with for-loops. This will set us up for working with more general loops, like while-loops, in the next lecture.

Reading: Chapter 7



Week 8

15 March (Thursday): For-Loops

[Handout]      [Presentation]
Demos
GDemo.java
acm.jar
Examples.java


Today we finish with the material necessary to get started on Assignment A5. We talk a little bit about graphics and drawing, but out primary focus is iteration and for-loops, a way to do a single task repeatedly.

Reading: Section 2.3.8



Lab 8: Exception Handling

[Instructions]

The purpose of this lab is to give you some experience with writing recursive functions. It is designed to be reasonably short so that you do not have to worry about working on this assignment over Spring Break.


13 March (Tuesday): Exceptions

[Handout]      [Presentation]
Demos
Parsing.java
Throwing.java
Catching.java
OurException.java


We have mentioned Exceptions in class several times now, particularly the dreaded NullPointerException. Today we talk about Exceptions in more detail. We show how to create them on our own (when an error occurs) and how to recover when we encounter one.

Reading: Chapter 10



Week 7

8 March (Thursday): Call Stack and Debugging

[Handout]      [Presentation]
Demos
CallStack.java
Worker.java
MathRecursion.java


Today we go into detail about the call stack, and show why it is an important concept for understanding error messages. In addition, we introduce some advanced debugging techniques that will be valuable in Assignment A4.

Reading: Sections 2.7 and 3.5



Lab 7: Recursion Exercises

[Instructions]

This lab gives you experience with writing recursive functions. All of the functions in this lab will either be recursive functions on Strings, or recursive functions on integers, just as we saw in class.


6 March (Tuesday): More on Recursion

[Handout]      [Presentation]
Demos
MathRecursion.java
StringRecursion.java
MoreRecursion.java
Turtle.java
Hilbert.java


Today we continue talking about recursion, with several examples. We look at the different ways that we can break up a recursive method. We also introduce some of the ideas that will be used in Assignment A5 after Spring Break.

Reading: Sections 15.1 - 15.3



Week 6

1 March (Thursday): Recursion

[Handout]      [Presentation]
Demos
MathRecursion.java
MathRecursionTester.java
StringRecursion.java
StringRecursionTester.java


Today we talk about recursion, a powerful computing tool and one of the hardest concepts in the course. Recursion is one of the foundamental principles of computer science, and used for a lot of advanced algorithms. We will see many applications as the course progresses.

Reading: Sections 15.1 - 15.3



Lab 6: Abstract Classes

[Instructions]

This lab introduces you to the useful software-engineering concepts of an "abstract class" and an "abstract method". The topic is covered in Section 4.7 of the class text and on lesson page 4-5 of the ProgramLive CD.


28 February (Tuesday): Interlude: OO Programming

[Handout]      [Presentation]
Demos
Temperature.java
BetterTemperature.java


Today we step back and look at the big picture of everything that we have done. Now that we know how Java works, we try to figure out why it works this way, and why it has become a popular tool for software development.



Week 5

23 February (Thursday): Casting and Overriding

[Handout]      [Presentation]
Demos
Animal.java
Cat.java
Dog.java


Today we return to the topic of type casting, and show how it applies to classes and subclasses. We discuss the difference between real and apparent type, and how this affects subclasses. This material will be the last new material on the first prelim.

Reading: Section 4.2, 4.3



Lab 5: Using Vectors

[Instructions]

Class java.util.Vector provides the ability to maintain a growable/shrinkable list of objects, which can be of great utility in cases where you do not know ahead of time how many objects will be in the final list. The purpose of this lab is to gain some experience with class Vector and learn just how useful it can be.


21 February (Tuesday): Inheritance

[Handout]      [Presentation]
Demos
Point3d.java
SquareJFrame.java
Employee.java
Executive.java


Today we talk about subclasses and inheritance: an important part of object oriented programming. This allows us to take classes that someone else created (such as the classes already in the Java API) and add functionality to them.

Reading: Section 1.6, 4.1



Week 4

16 February (Thursday): Wrappers and Containers

[Handout]      [Presentation]
Demos
Anglicize.java
AnglicizeTester.java


Today we provide and overview of everything that we have learned about methods, including some hints on Assignment 2. We also introduce a new type of class: the container class. This class allows us to keep lists of other objects.

Reading: Sections 5.1 and 2.5



Lab 4: String Exercises

[Instructions]

The purpose of this lab is to give you practice with developing the bodies of methods. At the same time, this lab will give you some practice with Strings.


14 February (Tuesday): Stepwise Refinement

[Handout]      [Presentation]
Demos
Demo.java
ReorderString.java


Today we go into much more depth about the String class. Using the String class, we show how to write methods that are much more interesting than what we have done so far. The key is stepwise refinement, which is a step-by-step way to write complicated methods.

Reading: Sections 2.5 and 3.1.2-3.1.3



Week 3

9 February (Thursday): Scope and Conditionals

[Handout]      [Presentation]
Demos
Point3d.java
Worker.java
StaticExample.java


Today we go into a lot of depth about methods, in order to understand them better. We present a formal model for thinking about methods. We also introduce static methods (methods that are not tied to an object) and conditionals.

Reading: Sections 2.1 - 2.4



Lab 3: Classes and Testing

[Instructions]

The purpose of this lab is to get you used to writing methods, and to introduce you to the basics of testing. Adopting a good testing habit will prove to be ' unbelievably useful, particularly for the first assignment.


7 February (Tuesday): Methods and Testing

[Handout]      [Presentation]
Demos
Point3d.java
PublicPoint3d.java
PublicPoint3dTester.java
Worker.java
WorkerTester.java


Today we finish everything that is necessary for the first assignment. We go into more detail about methods, and specifications. We also teach you how to test your programs with JUnit.

Reading: pp. 112-114 and Appendix I.2.4



Week 2

2 February (Thursday): Classes

[Handout]      [Presentation]
Demos
Point3d.java
Worker.java


Today we drill deeper into the idea of classes. We finally move from the Interactions Pane into "real" programming by learning how to make our first class.

Reading: Sections 1.4 and 1.5



Lab 2: Using the Java API

[Instructions]

The purpose of this lab is to get you comfortable with using the classes and objects that are already built into Java. This also means familiarizing yourself with the Java API.


31 January (Tuesday): Objects and APIs

[Handout]      [Presentation]
Demos
Point3d.java
Patient.java


Today we introduce the notion of an object, which we describe with our manilla folder analogy.

Reading: Section 1.4



Week 1

26 January (Thursday): Variables and Assignments

[Handout]      [Presentation]
Additional
Escape Characters


We talk about variables and the assignment statement. As part of the lesson, we introduce a conceptual model of how computers work.

Reading: Sections 1.2 and 1.3



Lab 1: Evaluating Expressions

[Instructions]

The purpose of this lab is two fold. First, it is designed to get you started with DrJava immediately. Second, gives you hands on experience with Java expressions, which we talked about on the first day of class.


24 January (Tuesday): Types and Expressions

[Handout]      [Presentation]
Additional
Course Overview
Learning Styles


We give an overview of the course and its expectations. We also talk about types and expressions, and show how to use DrJava to play around with these.

Reading: Section 1.1