Programming project
IT 2045 Final Project Spring 2021
Total Points: 65 (5 + 40 + 20)
Submission: Carefully follow all directions.
The project name should be YourUsername_final
Create two packages in your project. One package should be called “ExchangeApp” and the other package should be called “Drawing”. Place the .java files necessary in the appropriate packages.
Make sure both the programs run without any errors before submitting. Comment out any code that does not work.
Upload your Java Project as a single .zip file to Canvas under Assignments ->Final Project. If you have any trouble submitting or understanding how to submit, consult with me before submitting the assignment.
Include text files in your project folder (2 points) Follow directions in terms of naming and submission (3 points)
Problem 1 (40 points)
This problem requires you to put together everything you have learned in Computer Programming I and II. Note: If you have any trouble reading the currency_exchange_rates.txt file, let me know. Data is separated by tab “\t”. You can use javafx or drag/drop GUI designer if you want.
For this problem, you will implement The Foreign Exchange Application which is a GUI-based currency converter with the following features:
1. (3 points) Include three textFields
a. CurrencyTo
b. CurrencyFrom- set this to “United States” and make it uneditable
c. Amount
2. (2 points) Include two labels
a. A displayLabel that will display error messages or conversion values
b. An updateLabel that will display the last date the currency exchange rate was updated
3. (2) Include two buttons
a. A Calculate button that will compute the conversions
b. A Clear button that will remove the contents of the textFields and labels.
4. (16 points) When the Calculate button is clicked, do the following
a. Get the content from the textFields
b. From the text file provided (currency_exchange_rates.txt), get the exchange rate and the last updated date of that country that matches the country typed in the From textField.
c. Compute the conversion and display the result. Here is a sample ->
5. (2 points) When the Clear button is clicked, clear CurrencyTo & Amount textFields and all the labels.
6. (15 points) Implement error checking
a. Try/Catch for opening currency_exchange_rates.txt, update displayLabel with error message
b. If the amount is empty or letters are typed or negative numbers are typed, then update the displayLabel to print an error message.
c. If the country typed in cannot be found in currency_exchange_rates.txt file, update the displayLabel. Sample:
If you want to add additional features, you can. The GUI does not have to look like the one shown here. You are free to use colors, sizes, shapes of your choice.
Tips:
· First complete #1 through 6b and then implement error checking (6b, 6c)
· Set initial values for the textFields so you don’t have to type them as you develop and test the program. This will save you a lot of time!
Problem 2 (20 points)
This problem requires you to know how to draw points based on locations read from a text file. The sample code for WK14 and the weekly exercises regarding drawing will help you in completing this project. Start with the code I provided for the final project. Remember to update the package information on top of each file.
<- Here’s a sample of what you are starting with. When the ShowChart button is clicked, the program is reading the file drawing_data.txt to get the locations of the points and then drawing them.
Every time you click ShowChart it draws the same points in red but with a random background color.
<- (10 points) Here’s a sample of where you need to be. When the ShowChart button is clicked, the program is reading the file drawing_data.txt to get the locations of the points and the RGB color values of each point, then drawing the points with the corresponding color. You can use three separate ArrayLists or a single Color type ArrayList for storing the RGB values.
(5 points) Every time you click ShowChart it draws the same points with the same colors read from the text file but with a random size.
(5 points) When the ClearChart button is clicked, clear the drawings.
You are welcome to add any other feature of your choice to this drawing program.