CSC 314: Programming in Java

Winter 2001

Individual Assignment 6

Database Access:
Yet Another Currency Exchange Program

Due Friday March 2 before 11:30pm

Overview

For this week's assignment, you will rewrite your currency exchange program so that it accesses currencies, rates and formats from an Access database. In addition to database access, the program should have separate classes for the user interface and for accessing and calculating currency exchanges.

Specific Requirements

Your program should access currency names, rates and formats from the rates table in the Currencies database. The rates table has three fields:

You may download my currency database (an Access database) that has a rates table with these fields. To complete this assignment, you must register your database as an ODBC data source (see section 18.6.1 in Deitel and Deitel). You may add additional currencies to your currency database, but your program should run with any database that uses these fields in this order. It appears that you can connect to my supplied database without having MS Access on your computer. Of course, you will not be able to add new records to the database. If you only have MS Access 97, here is the database using the older version.

Your program should have two classes. The Exchange class constructs and displays the graphical user interface. It should not perform an currency calculations. Instead, it relies on the CurrencyConnection class, which connects to the database and performs all currency conversions. In particular, it should provide the following methods:

To get started, I have provided the beginnings of the CurrencyConnection including some test code in its main method. You will want to create more test code to make sure your class works before trying to integrate it with your user interface.

Your program should be able to convert from any of the listed currencies to any other listed currency. While you may choose how to construct your interface, I will present recommendations in class.

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.