CSC 314: Programming in Java
Winter 2001
Individual Assignment 3
Currency Exchange: A Simple Graphical User Interface
Due Friday February 2 before 11:30pm
The Web is full of simple calculators and converters including
those used for metric conversion, mortgage calculation and HTML color
codes. For this assignment, you will introduce yet another such
calculator. This product produces currency equivalents. For example,
if a user wanted to know the equivalent in French francs for US$12, your
product would allow the user to supply the figure and then display the
amount in francs (approximately 84 francs).
The overall design is up to you, but it should at least follow
these requirements:
- The interface should at least perform conversions of US dollars to
one of 3 different currencies and from those currencies into dollars.
- Currency conversion factors should be declared as constants at the
beginning of the class declaration. Later we'll learn how to access
this information from a file, database or Web page.
- Use the swing components as discussed in class and in the Deitel
and Deitel text.
- Call your public class Currency, which should extend the
JFrame class, and place it in the file Currency.java.
Here are some tips for helping you complete this assignment:
- The temperature conversion interface (TempFrame.java) provides a good starting
point for this assignment.
- Only buttons and text fields are needed to do a reasonable job, but
you may use other graphical components if you choose.
- Use the flow layout manager and experiment with different frame
sizes in order to obtain a reasonably looking interface.
- For this assignment, do not worry about handling invalid data from
the user (e.g. letters instead of numbers). We will learn how to take
care of invalid user input later.
Submission
Before the due date and time, you should submit the following
file through the submission
Web page:
- Your individual version of Currency.java
The grader will use this sheet for
evaluating the asignment.