Homework Assignments.


Last updated on March 18, 2000.



Class Web Page and Hello World Applet

Simple Plot Applet

Getting the Lay of the Land on Swing

Plot Applet Design

Plot Applet Design/Coding


  1. Class Web Page and Hello World Applet
    Your first assignment is to get your class web page set up. Your class page should have
    1. a section for Java Resources (books, web sites, etc.) that you have checked out and your comments on them;
    2. a section which lists the class projects you have worked on with links to more detailed discussions including web pages with applets when that is appropriate; and
    3. 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.

    The programming project for this assignment is to get a personalized copy of the HelloWorld applet running on your class project web page. These are the basic steps to accomplish that:

    1. Copy the HelloWorld source code from my web page and save it as a file in your web directory with the name HelloWorld.java.
    2. Compile the applet using the javac command. You will then have a file called HelloWorld.class in your directory
    3. Modify your web page so that it contains the following statements
         <applet code="HelloWorld.class" width=300 height=150>
         </applet>
         <hr>
         <a href="HelloWorld.java">The source.</a>
      
    4. Once you can get the applet to run, make some modifications to "personalize" it.
      Please report any problems to the list. Somebody may have already gone down that road, and can provide some help.

  2. Simple Plot Applet
    Your second assignment is to study the Really Poor Plot Applet and make a list of ways that it can be improved. Indicate the type of improvement: more robust, more general, better code reuse, easier to modify. etc.

    Program an applet that will do one of the following plots. Each member of a "design team" should do a different plot. Each plot should have your name as the title. Every plot will use the following data, and the x axis should always be labeled as "Time in Hours".

    		x values = { 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0 }
    		y values = { 3.2, 2.4, 1.1, 0.3, 1.2, 3.1, 2.7, 1.8, 0.9, 2.1 }
    		z values = { 132, 214, 111,  30, 250, 310,  10,  90, 180, 270 }
    

    1. Plot the x,y pairs with red boxes and plot the x,z pairs with green triangles. Connect the data points with black lines. Display the y axis on the left and label it "Temperatures". Display the z axis on the right and label it "Voltages". Scale the left and right axes so that the maximum y value and the maximum z value are displayed at approximately the same height.
    2. Connect the x,z data points with black lines. At each data point draw an error bar (an I shaped icon whose height is (y/100)*z). That is, interpret the y values as the percentage error that may be in each z measurement. Display the z axis on the left and label it as "Caloric Intake".
    3. Plot the x,y pairs with green triangles. Plot the x,z pairs with red crosses. However, the actual vertical distance should be the log base 10 of z. On the left display an axis so that its height is the ceiling of the maximum of the maximum y value and the log base 10 of the maximum z value. Connect the data points with black lines. Do not label this axis. Display a legend which shows the two different icons (the green triangle and the red cross with the labels "Temperatures" and "log Ohms" respectively. Display the legend with an enclosing box.

  3. Getting the Lay of the Land on Swing
    Our first serious class project is to develop a good general Plot Applet -- one that we will be able to grow with our goal of providing a interactive web window into a simulation. To this end it is important to discuss and to think hard about the design of this applet. Gaining some insight into the design of the Swing package should help in this endeavor. For Friday, 2/11/2000, turn in a paper which shows the inheritance structure of a JApplet and a JFrame. List all the methods which are defined for these two objects -- most of which are inherited. Only list the names of the methods, and do not include any deprecated methods. The purpose of this exercise is to get a true sense of the complexity of the object classes for a sophisticated Graphical User Interface.

  4. Plotter Applet Design
    Your fourth assignment is to develop a design for a Plot Applet. I have uploaded a Powerpoint presentation from the Rational Software Corporation which provides an overview of the software design process. In particular, it illustrates many of the different types of diagrams used in UML, the Unified Modeling Language.

    Phase One will consist of the development of a complete (hopefully) list of classes along with their responsibilities and collaborators. This part of the design should be turned in on CRC cards.

    Here are the results of thePhase One CRC efforts as of March 18, 2000.

    Phase Two will consist of the development of class interactions and the class specifications. This part of the design should use the UML notation. If these two phases are done properly, then the interfaces should be correctly and adequately specified, so that the actual coding can be done be separate individuals.

  5. Plotter Applet Design/Coding
    We need to move forward at a much more agressive pace. The goal is a SIMPLE working version of the plotter applet before Spring break. Many features will not be implemented, but enough needs to be done to show that the basic interface design is solid.
    1. Each Design Group needs to assign a team to each of the four major components of the plotter project.
      1. Plotter, the JApplet that manages the entire layout;
      2. VData, the component that stores the data for the current document;
      3. SSView, the component that provides a spreadsheet view of the information in VData; and
      4. PlotView, the component that provides the plot view of data in VData.

      Please send me the assignments ASAP.

    2. Start coding -- but do not worry as much about filling in the details as filling in the constructors, the attributes, and the methods. Make copies of this information in a UML class diagram. As the interface becomes clearer, develop class diagrams showing the relationships between classes within each major component and a diagram showing the relationships between the major components. Use stubs in your code as much as possible.

      I want formal progress reports every class.

    3. Write up a list of menu items organized by major component.