FINAL REPORT

 

Abstract

JAWAA is an acronym that stands for Java and Web-based Algorithm Animations. It is a simple command language that is used as a tool for computer science education. It was created in 1998 by Duke professor, Susan Rodger, and one of her undergraduate students, Willard Pierson. JAWAA allows students and educators to create animations using built in JAWAA objects that teach computer science concepts such as those relating to arrays, queues, stacks and lists among others. Each line of JAWAA code consists of one command. This file of command is stored in a script file with a .anim extension. In order to function properly, there must be two files of the same name--one must be that with the .anim extension, and the other must be an html file. The html code is really simple and can be copied from the JAWAA homepage and used for all animations. Once these two files are created, the applet can be run from any web-browser. Another feature worth noting is that JAWAA can be incorporated into any program written in any language and outputted into an animation file. JAWAA is useful because it makes the learning process easier for students, by providing a visual representation of the computer science concepts. It also benefits educators by providing a simple tool for teaching.


Introduction

JAWAA is an acronym for Java and Web-based Algorithm Animation. It is a simple command language that is used as a tool for computer science education by creating data structure animations and running them through web-browsers. Dr. Susan Rodger and Will Pierson originally created JAWAA in 1998. Since that time, students have been working on further development to enhance its capabilities.

JAWAA as a Tool for Computer Science Education

JAWAA is currently being used in Dukeís CPS 49S, CPS 6, and CPS 100 courses. However, this tool is not only used here at Duke. It is in demand in locations around the globe and is increasing in popularity. This is because JAWAA is a simple language that requires the user to have very little programming skills, which makes using the tool extremely easy. Even for those who are not classified as visual learners, some type of visual representation is always beneficial. It simply makes learning more fun. JAWAA allows the instructor to create animations that represent different computer science concepts thereby using it as a teaching tool to help students better understand these concepts. This is extremely helpful to students just starting out in the CS curriculum.

As mentioned earlier, JAWAA is used extensively at Duke. The CPS 49S course is a freshman seminar in which the students are beginners and have no programming experience. JAWAA commands are typed into an animation file or generated by the JAWAA Editor and run over the web as an applet. CPS 6 is the first course for majors. The focus of this class is to learn the C++ programming language. Therefore, JAWAA is hidden in the classes that students use, automatically generating the JAWAA code. CPS 100 is the second course for majors. At this point, the students are familiar with the syntax of C++ and are able to add JAWAA commands to their programs on their own. By doing this, data structures are easily animated as a result of their program.

Once students have learned the basic concepts, it is easy to incorporate the JAWAA code into their program in order to create a JAWAA animation from the programís output. These programs can be written in any language, which allows a lot of flexibility. As previously stated, JAWAA requires very little programming knowledge. Once you know the basic format of how JAWAA commands are written, they are relatively easy to write.

JAWAA Objects

There are two types of objects that can be generated by JAWAA--primitive and intelligent. Primitive objects include rectangles, circles, ovals, polygons, lines, and text. The specifications for each are similar. They all have a name to uniquely identify the object, location points or coordinates, outline and fill color, and depending on the object, a width and/or height specification.

Intelligent objects include nodes, arrays, queues, stacks, lists and list-pointers. Their specifications include a name that uniquely identifies the object, coordinates or starting location, outline and fill color, width and height specifications, data needed, orientation and/or type specifications if needed, and header name for lists.

JAWAA Commands

JAWAA has built in commands that make manipulation of objects easy. Most of the commands are general and can be applied to any type of object, but some are specific to the data structures. The changeParam command for example allows you to change the parameter of any object. Examples of some general parameters that can be changed are data for an array element, fill color for a polygon, or width of a node. The groupObject command allows you to create a group of objects by giving a name, specifying how many items will be in the group and listing each item. After grouping the objects, functions can be performed on this group of items as if it were a single object. The moveRelative command animates the relocation of an object from one position to another. The scale command changes the size of an object by specifying a percentage for it to be scaled to. The delay command allows you to specify a delay time in-between command executions. The remove command removes an object from memory and releases the objectís name, which allows it to be re-used.

Specific to the node data structure are the connectNodes and moveMarker commands. The connectNodes command allows you to connect already existing nodes to form a linked list. Markers can be created to place emphasis on a specific node. The moveMarker command moves a marker from one specified node to another. The dequeue and enqueue commands are the two commands for the queue. Their functions are to respectively, remove and add elements to the queue. The push and pop commands are specific to the stack data structure. Data items can be pushed onto or popped off of a stack.

JAWAA Modifications

One of the main benefits of JAWAA is how easy it is to create and manipulate objects. Our goal for this summer has been to thoroughly test JAWAA and make it as easy and intuitive as possible. By testing it, we encountered a few problems that we thought should be fixed. They are listed below:

  • One of the first things that we noticed was that for each object, there were parameters for the fill color as well as the outline color. By default, the color of the text was the same as the outline color. However, if the outline color was changed, the text color did not. We added a separate parameter for the text color that can be changed independent of the outline color.

  • We also realized that the size of the text couldnít be specified when the actual text was created. The text would have to be created and if the user wanted the size to change, it would have to be done with a changeParam command. We added point size as a parameter for creating a text object.

  • There are a lot of different things that can be done to manipulate JAWAA objects, but the possibilities became limited once we grouped them. For example, if we grouped a circle, array, and list, and decided that we wanted to change the background color of each to red, it would not do it by calling a changeParam command for the group, but instead we would have to change it for each of the objects. We modified the code to allow it to change as a group effect.

  • We were currently working with JAWAA Version 2.0. A lot of things had been changed and some things were no longer functional. One of them being nodes. In this version, stand-alone nodes did not work, but they did if they were a part of the list. We compared the new code with the old code, but didnít find any significant differences. We eventually created a different class for nodes and set everything up to use it as opposed to the older one.

  • With arrays, manipulation could only be done to single elements and exceptions were thrown if the array itself was addressed. We made modifications in order to allow the entire array to be addressed. For example, if we wanted to change the background color of an array, previously, each cell would have to be called on and changed individually, now we can just call the array itself and all of the cells would change.

  • With lists, a lot of functionality was added. We added a parameter for a head pointer to the list, set up the command line to recognize whether the nodes to construct have already been created or not. If they havenít, then we set it up to where the data for the node could be specified after itís name.

Modifications with the JAWAA Editor

A component of JAWAA is the JAWAA editor, created by Thomas Finley, a Duke University undergraduate, in 2001. This editor allows one to lay out animations graphically by laying out objects, and then modifying them across time. The editor also has the ability to export the animations to a .anim file, a text document with commands that displays the animation in a web browser as an applet. The purpose of the editor is to make the creation of animations easier. Configuration of the location of the objects is automatic as opposed to having to plug in coordinate values and working based on trial and error. Once the animation is exported to an .anim file, it can be combined with or edited as animations hand-written in JAWAA. This is useful because it reduces the time to create the animation and it allows animation files to be combined.

The Editor is a useful tool, but we found there were few minor incompatibilities with it and JAWAA. Some of the changes we had to make included modifying the original code to match the code we modified to make nodes function properly. Also, we noticed that when the animation file is extracted, some of the wrong keywords were outputted. For example, to create a polygon, one has to specify a name, coordinates, the number of points to be created, the coordinates of each point and so on. The JAWAA Editor did not output the number of points to be created which caused errors to occur when the animation was trying to run. Also, JAWAA recognizes the keyword ěrectangleî, but the Editor output ěrectî, which JAWAA did not recognize. All of these minute incompatibilities were changed and currently everything functions as expected.

Future Work

Hopefully by now, the many capabilities of JAWAA have been exemplified. A lot has been done, but there are some things that we still need to work on. The next step is to implement a tree command, and following that, we would like to implement a graph command that will allow the user to specify a layout from the layouts that we will have built in.

Conclusion

In conclusion, JAWAA is an excellent tool for aiding with the teaching of computer science. Students will feel more rewarded by actually seeing a visual representation of their programs and take pride in showing it off to others. JAWAA is now fully functional and compatible with the editor, which makes it even simpler to create animations.