code

Date Lecture Topics On Your Own
 
Week 2
December 10
  • review
December 8
  • socket fun
  • port and client and server
  • protocols, like HTTP
  • a translation server
December 6
  • a better sort?
  • merge sort
 
Week 14
December 3
  • finish up DreamVacation
  • overriding FooPlace.add in PinPlace
  • walking through an inheritance hierarchy
December 1
  • inheritance in GoogleEarth's KML
  • writing our own exception class
  • abstract
November 29
  • finish up WiiRange
  • protected
  • exceptions
  • checked vs. unchecked
 
Week 13
November 19
  • making our own types
  • a Raffle is-a     
  • finishing up WiiRange
  • invoking the superclass constructor
  • overriding
  • Check out the Inheritance and Interfaces problems at Practice-It!
November 17
  • sharing implementation with inheritance
  • writing a DuckHunt clone using a Wiimote
November 15
  • recursion
 
Week 12
November 12
  • no class
November 10
  • review
November 8
  • binary search
  • comparing algorithms
  • a peek at exceptions and inheritance
  • throws and extends
 
Week 11
November 5
  • finishing up sorting of Orderables
  • the dangers of downcasting
  • sorting states by name
  • linear search
  • binary search
  • Check out the old exams posted on the discussion board.
November 3
  • what does this do?
  • finishing up our text editor
  • finding minimum value in a sublist
  • sorting with selection sort algorithm
  • making sorting general with an Orderable interface
  • Planet[] planets = {
      new Planet("Mercury", 0.4, 0.055),
      new Planet("Venus", 0.7, 0.815),
      new Planet("Earth", 1.0, 1.0),
      new Planet("Mars", 1.5, 0.107),
      new Planet("Jupiter", 5.2, 318.0),
      new Planet("Saturn", 9.5, 95.0),
      new Planet("Uranus", 19.6, 14.0),
      new Planet("Neptune", 30.0, 17.0)
    };
    
  • Check out the builtin Comparable<ClassName> interface for a typesafe version of Orderable.
November 1
  • finishing up Slideways
  • writing an under-100-line text editor
  • inner classes for action listeners
  • Use a GridLayout full of JButtons to write a GUI wrapper for pre3.Memory.
 
Week 10
October 29
  • tweaking our graphing calculator
  • graphical user interfaces in Java Swing
  • JFrame, JButton, and JLabel
  • handling user events with interfaces
October 27
  • supertypes and subtypes
  • the well-worn Shape hierarchy
  • when can interfaces be used?
  • writing a GraphingCalculator that can plot any function
October 25
  • what Java features are in other languages?
  • separate that which changes from that which doesn't
  • coding at a high-level and for scalability with interfaces
  • interfaces in The Three Littles Pigs
  • guess-a-number with interfaces
 
Week 9
October 22
  • wrapper classes
  • more tip analysis
  • ArrayList under the hood
  • Read chapter 9.
October 20
  • foreach loops
  • finish up 52-Card Match simulation
  • tip analysis
October 18
  • You walk into a casino and discover that they are offering an exciting new game called 52-Card Match, which is played with two ordinary 52-card decks of playing cards.

    The player is handed one deck, and the dealer takes the other. The dealer thoroughly shuffles his deck and sets it face down in front of you. You can shuffle your deck as thoroughly as you please and then also set it face down in front of you.

    The cards are then turned over one at a time from each deck, i.e. one from each deck is turned over simultaneously each time. If any pair matches exactly (rank and suit), the game is over and the casino wins. If you make it through the whole deck without a match then the player wins, and is paid out at 2:1 odds.

    Should you play this game?

  • switch
  • Plot a Histogram to a Graymap.
 
Week 8
October 15
  • mysteries of file writing
  • birthdays equiprobable?
  • choose your own lecture: plot histogram or alter image?
  • Read up on ArrayList in chapter 7.
October 13
  • arrays of arrays in real software
  • continuing birthday repeats
  • Graymap
  • PGM
  • PrintWriter
  • Plot a smiley face onto a Graymap!
October 11
  • finish filling a histogram
  • the birthday problem
  • arrays of arrays
 
Week 7
October 8
  • Read chapter 7.
October 6
  • finishing up demographics
  • declaration-initialization combo shortcut
  • command-line arguments
  • getting a list of files
  • RestaurantPicker
October 4
  • problem: ComS 227 demographics
  • reading files
  • numbered rather than named data
  • arrays
  • new type[#]
  • .length
  • Write a 1-D text-based Minesweeper game.
 
Week 6
October 1
  • no class
September 29
September 27
  • loops in real software
  • spreadsheets: fill sequences
  • for (setup; condition; update) {
      action;
    }
  • nested loops
  • System.out.printf
  • VirtualWall
 
Week 5
September 24
September 22
September 20
  • finishing up Catch
  • getting things to repeat with loops
  • how to write a loop:
    1. compose step to repeat (action)
    2. wrap it up in curly braces and attach a loop
    3. write test for repeat (condition)
    4. update the condition inside the loop (update)
  • while (condition) {
      action
      update
    }
  • guess-a-number
  • Read chapter 6.
 
Week 4
September 17
September 15
  • what does this do?
  • custom-tailored output in Flashcard
  • conditionals on the big screen
  • routing around trouble
  • checking password equality
  • if/else if
September 13
  • Boole
  • what are booleans for?
  • boolean operators: && || !
  • truth tables
  • conditional statements
  • Read chapter 5. We've covered a good chunk of chapter 4, but you may want to look through it too.
 
Week 3
September 10
  • more on relational operators
  • classifying Monsters
  • finishing LineFu
  • comparing doubles
  • String concatenation
  • toString
September 8
  • Read chapter 3.
September 6
  • no class
 
Week 2
September 3
  • finish StopWatch
  • classes as actors
  • String
  • Scanner
  • "Hello, API!"
  • Write a main method that prompts the user to enter his birthday in the form Y M D. Retrieve these values with a Scanner and use them to construct a GregorianCalendar instance for the user's birthday (see the second constructor listed in the API). Make another GregorianCalendar instance for today's date (see the first, default constructor). Use the getTimeInMillis method and find the difference in milliseconds between the two dates, and figure out how old the user is.
September 1
  • classes: marrying data and methods
  • our first class: NDeckerBurger
  • instance variables
  • new
  • class vs. instance
  • classes as objects, data as state, methods as behavior
  • StopWatch
  • For a philosophical take on classes, brush up on Plato's Theory of Forms.
August 30
  • the EDVAC model
  • methods: treating instructions symbolically
  • method anatomy
  • advantages: readability, reusability, debugging
  • Write a macro in Microsoft Word to make the highlighted text both bold and italic in one fell swoop. (You can write macros without touching code by recording actions as you apply them to real text.) This macro is essentially a method -- a complex instruction.
 
Week 1
August 27
  • a penny for your data
  • primitive types and their consequences
  • operations provided by the Math class
  • variables: treating data symbolically
  • Read chapter 2.
August 25
  • the killer application
  • welcome to Eclipse
  • essential pieces of computation: data and operations
  • variables and constants (final) in Java
  • int and double
  • choose your own problem:
    1. how much do a toothbrush, deodorant, and tomato cost at Fareway?
    2. approximately how much blood did mosquitoes draw from me this summer in Ames?
    3. how many Marston Water Towers would it take to hold the oil spilled into the gulf this past summer?
    4. in 2000, Jeanne Van der Meiren assembled 22025 paperclips into a chain in 24 hours -- is that beatable?
  • Write a class with a main that has five variables for the different graded components of this course. Compose an expression to calculate your final grade from these scores.
August 23
  • introduction
  • feedback:
    1. name
    2. last unassigned book you read
    3. if not computers, what else would you do with your life?
  • metalecture: course information
  • teaching machines: PicoCricket
  • Read the syllabus.
  • Read chapter 1.
  • Go through the Getting Started business on WebCT. If you are on a Macintosh, see the note there about configuring the correct Java version to use.
  • Join the game development competition.