CSC 314: Programming in Java

Winter 2001

Individual Assignment 5

Applets and File Access

Due Friday February 23 before 11:30pm

Part 1: Creating an Applet

Convert your currency exchange application into an applet. Assume that the file with the exchange rates is stored in the same folder as the applet's class, whether it is on the server or on a local disk. You may use either Swing components or AWT components. You may prefer AWT components since most browsers support these. Your applet will be tested with the appletviewer program, which works with either type of components. Call your applet CurrApp.java. Create an html file called CurrApp.html, which accesses the class file of your applet.

Part 2: Purchasing program

Create a new application, which allows a user to view a list of items and their prices. The user should be allowed to choose among the items and specify the desired quantity of each selected item. Your program should display which items are selected and keep a running total. Finally, the program should create a report that at least lists the quantity of each selected item and the total price of the entire order. Allow the user to save the report using the JFileChooser class. Ideally, this program should allow a user to undo any operation. At minimum, your program should allow the user to start over.

The interface design of this application is up to you. I strongly encourage you to follow these steps when creating your design:

  1. Using pencil and paper, draw a picture of your interface.
  2. With only minimal explanation, ask a "test user" if they can tell how to select items and specify their quantity.
  3. Revise the drawing based on the test user.
  4. Code the interface based on your drawing.

The list of items and their prices should be read in from a fixed file. The format of the file is up to you. Call your application Store.java.

Submission

Before the due date and time, you should submit the following files through the submission Web page:

The grader will use this sheet for evaluating the assignment.