Homework Assignments.


Last updated on August 24, 2008.



Install the BlueJ IDE

Class Web Page

Subscribe to the SafariU Online Bookshelf

Reverse

Hello World Applet

Simple Draw Applet with a Circle


  1. August 20: Install the BlueJ IDE
    1. Download the BlueJ Integrated Development Environment (IDE)
    2. Install the IDE on the computer(s) that you will be using for this course.
    3. Download the BlueJ Tutorial.
    4. Work through the first 19 pages of the tutorial
  2. August 25: Class Web Page
    1. Set up a class web page.
      • Put your name on the page.
      • Create a section which lists your class projects with links to applets and web pages with detailed discussions when appropriate.
      • Create a section for Java Resources (books, web sites, etc.) that you have checked out and your comments on them.
      • Create a link back to your home page so that the curious can find out more about the other dimensions of your personality and related stuff like resumes.
    2. Send me the url for your class web page.
    3. Check out the information about yourself on the Meet the Class page, and send me an email about any corrections that need to be made. Of course, the link to your class web page will not work until you let me know the url.

  3. August 25: Subscribe to the SafariU Online Bookshelf
    • Surf to SafariU and subscribe to the online bookshelf.
      (O'Reilly refers to the Online Bookshelf as an Online Syllabus.)
      This assignment is no longer required, since O'Reilly has apparently discontinued this service.
      For the basics of Java programming, study the free version of Bruce Eckel's book, Thinking in Java. You can read it online or download it it from his web site. Be sure to familiarize yourself with the other available Java Resources. and the annotated list of books and references.
  4. August 27: Reverse
    1. Set up the HelloWorldApplications project in BlueJ (or the IDE of your choice) using the four Java files that I sent you.
      • MinHelloWorld.java
      • HelloWorld.java
      • Echo.java
      • Echo2.java
    2. Copy the Echo2.java file and create a class called Reverse1. This class should have a single method which echoes the arguments in reverse order. The command line
      java Reverse1 How now brown cow?
      should print out
      cow? brown now How
      This method should not print any additional information other than the reversed list of arguments. This means that you will need to delete some lines from Echo2. It is also the case that you may find the while loop more useful for this exercise than the for loop. Compile and test your code. When it runs correctly email me a copy of the code. The subject line should read "Reverse1.java".
    3. Copy the Reverse1.java file and create a class called Reverse2. This class should have a single method which echoes the arguments in reverse order and prints each argument in reverse order. The command line
      java Reverse2 How now brown cow?
      should print out
      ?woc nworb won woH
      This method should not print any additional information other than the reversed list of reversed arguments. Compile and test your code. When it runs correctly email me a copy of the code. The subject line should read "Reverse2.java".

  5. August 29: Hello World Applet
    1. Copy the html file and the Java source code from my HelloWorld page.
    2. Modify the code (add your name and change the colors).
    3. Compile your code, and set up a page with your own HelloWorld applet.

  6. September 5: Simple Draw Applet with a Circle
    For this project create a web page with an applet that draws rectangles, squares, ellipses, and circles. It should also be able to draw these figures in red, blue, green, orange, and white. Link to this page from your class page. This page should be almost identical to the SimpleDraw Applet Version 1 web page.

    A copy of SimpleDraw1.java was emailed to you, and the source code is also available in the Java Examples section under the SimpleDraw Applet Version 1. You will need to modify SimpleDraw1.java in several places, and you will need to develop a new class called MyCircle, which will be a subclass of m865.shapepack.Ellipse. The source code for the MyCircle class that you develop should look very similar to the source code for m865.shapepack.Square - a copy of which was also emailed to you and discussed in class. The major difference is that your class will not be a member of the m865.shapepack package.

    In addition a jar file, m865.jar, was sent to you. It contains the class files for the m865.shapepack package. To use this package in BlueJ simply add the jar file in the Libraries tab of the BlueJ Preferences dialog. To use the package with your web based applet, put the jar file in the directory which will contain your SimpleDraw1 applet, and extract the class files from the jar file using the command

    jar xvf m865.jar
    The files should automatically be placed in the subdirectory m865/shapepack and your compiler should be able to find them given the source code statements
    import m865.shapepack.Shape;
    import m865.shapepack.Rectangle;
    import m865.shapepack.Ellipse;
    import m865.shapepack.Square;