Mr. Gilmore's Course Pages

Welcome to SJP's Java class website!

May 6, 2010: Success Hunting Ducks

The second phase of the Duck Hunting project has been a resounding success. With Logan's supervision, the coding of the Johns, Joe, Zach, James, Chris, and Matt, and Felix's images, the result is excellent.

The headline link leads to a page generated by Greenfoot's export to web page function. That function converts the code to an applet, a program that runs in a web browser. The user's computer gets the code from the server and runs it. My first efforts playing the game as an applet lead to the following observations.

  1. Firefox doesn't seem to display the applet and run it properly
  2. The game board is a bit big if we anticipate playing it in this way

March 18, 2010: Sample Code to Work With

Here's the current Wombat code I'm working with in class. Use this file to add comments to the first 15 lines OF CODE (about to line 27). Be sure each comment shows that you understand what the line of code does. Obviously this code is based heavily on (i.e. it's the same as -- with a few tiny changes) the original Wombat class distributed in the Wombat scenario in Greenfoot.

January 10, 2010 Extra Credit Options

Some people have asked if I could assign some extra credit. The following JavaBat problems may be done for 6 points of extra credit each. The later the problem is in the list, the harder it probably is. Get the easier points first.

Set one. Do as many of these as you'd like; the ones you choose to do must be done by Monday morning, January 18 when I will check these.
Logic-2 Problems: makeBricks loneSum luckySum noTeenSum roundSum closeFar blackjack evenlySpaced makeChocolate
String-1 Problems (consult the Java API for methods of the String class that might be useful): endsLy nTwice twoChar middleThree hasBad atFirst lastChars conCat lastTwo seeColor frontAgain minCat extraFront without2 deFront startWord withoutX withoutX2

Set two. Do as many of the Array-1 problems as you'd like; the ones you choose to do must be done by Tuesday morning, January 27 when I will check these.


January 5, 2010

The following JavaBat problems will be due this week. All are from Logic 1 unless otherwise specified.


Wed: teaParty, twoAsOne, inOrder, inOrderEqual
Thur: lastDigit, lessBy10, withoutDoubles, maxMod5, redTicket
Fri: greenTicket, blueTicket, shareDigit

In addition, it would be smart to continue looking at Greenfoot scenarios that present you with some good code to build on when you create "Dodge the Dean".

December 4, 2009

As we progress with our latest Elevator incarnation, it's worthwhile thinking about how exciting elevators can really be. Perhaps in the future we can extend the Passenger class to create subclasses such as Human and Vampire and Werewolf.

September 29, 2009

Now that we're drawing to the close of our first unit -- JKarel the Robot -- it's time to take a step back and consider what the essential lessons are.

  • Problem solving is best done in phases. Programming is not typing, so don't begin on the keyboard. Understand the problem. Break it into parts. Write comments to yourself about how to solve each part. Then code up a part and test to see if your solution works. Continue till you've done all the parts.
  • When coding, write short methods that perform simple, clear tasks and do not cause any side effects. A method longer than a page is a bad, bad idea. Nesting if/else statements more than three deep is a bad, bad idea.
  • Format your code according to the standards we've talked about. As you write, align your curly braces correctly. Begin class names with a capital letter. Begin robot object names with a lowercase letter.
  • Use sensible names for methods. For example, I saw "hitWall" as the name of a method designed to ensure that a robot doesn't hit a wall. This is obviously a bad, bad idea. "checkIt" is also a terrible name. Check what? Write clear method names, but of course avoiding abominations like anyBeepersInBeeperBag() and instead use something like hasBeepers().
  • Back up your work. Save to the network and backup daily to your flash drive, or save to your flash drive and back up daily to the network. I don't care which. But I do care that you do it. I simply won't accept loss of data as an excuse for lateness of an assignment

September 7, 2009

During the year I'll use this page to keep you up to date on what's transpiring in our Java course. I'll add useful resources and commentary on what's essential to gain from each of the chapters in Head First Java (2nd edition). Homework assignments for the past few days and next few days will be in the panel on the left. The panel on the right will contain useful links to outside resources that will help you learn to program in Java.

Bookmark this page so you can quickly access it during the school year.

Materials You Need for this Class
Material Use
flash drive (usb, 1 GB is plenty) backups of all course files
Head First Java , 2nd edition Explanations, sample code, website tools
notebook: 3 ring binder, 2" thickness minimum, with 2 dividers Storing notes and handouts

SJP Links

Schedule of Assignments
Date Reading DueAssignments Due