COMP-202
Introduction to Computing 1 -- Lecture Slides Dan
Fall 2011

Lectures

Lecture slides and related source code will be posted by Dan here.

Dan's Lectures

Date Topic(s)
2011-09-02, 2011-09-07 Introduction
  • (lecture)
  • Running a program
  • HelloWorld.java You can download this version directly. If you cut and paste in to notepad then make sure to be careful that the file is exactly HelloWorld.java and not helloworld.java or HelloWorld.java.txt or "HelloWorld.java"
Some people pointed out after class they were having trouble finding the jdk 6 for windows 64 bit systems on the new layout of the page. You can try the following link. http://download.cnet.com/Java-SE-6-0-JDK-6/3000-2212_4-10857945.html On next class, we'll go over how to run a Java program in a bit more detail.
2011-09-09 Planning; Basics on Computer memory; Basic Java structure
2011-09-12, 2011-09-14, 2011-09-16 Variables, expressions, and types; Reading from the keyboard; Writing to the screen.
2011-09-19, 2011-09-21, 2011-09-23 Using library methods, writing your own methods, if statements, boolean expressions, and comments.
2011-09-26, 2011-09-28, 2011-09-30, 2011-10-03 Loops and iterative methods: while loops, for loops, nested loops, static variables.
2011-10-05, 2011-10-07, 2011-10-12 Arrays, Basics of reference types, Examples of loops
2011-10-14, 2011-10-17, 2011-10-19, 2011-10-21, 2011-11-09 Object Oriented Programming basics
  • Unit6
  • Card.java Card example from class. There are some comments in the file explaning what happens. It should be viewed at the same time as CardGame.java . Note that this example is very similar to what you will have to do in question 1 of the 3rd assignment. Next class, we will create a constructor for Card. (Remember a constructor is called whenever you write new Card() )
  • CardGame.java
  • Card.java (from WarGame example) In class, we did an example of the game of War. We did not finish the example Friday, but I'm posting the example online. We can go over it in class on Monday. This is fairly complicated code, especially in War.java, but you should be able to understand most of it with some work. When we do more stuff with Objects after the midterm, we'll see that we can GREATLY simplify the code by creating a class CardPile that maintains all of the array logic in it..
  • War.java (from WarGame example)
  • Miscellaneous announcments: On Monday we will go over an old exam as well as the War.java example. On Wednesday we'll go over some practice exam questions that I post online. On Friday, Jorg will substitute for me. On the following Monday in class we'll have midterm cramming session and then that evening we will have the midterm.
  • RecipeExample.txt
One key thing to get out of the Card example is that by making properties PRIVATE we have much more control over them. We can go through the Card.java file, check all the times that suit was set to different values, and make sure it never has an illegal value.
2011-11-11, 2011-11-14, 2011-11-16 More advanced objects/generics: ArrayList, HashSet, HashMap
2011-11-18, 2011-11-21, 2011-11-23, 2011-11-25, 2011-11-28 Recursion
2011-11-30 Exception Handling