$25
CNT4714 – Programming Assignment #1
Title: “Program Assignment 1: Event-Driven Programming”
Objectives: To practice event-driven programming using Java-based GUIs. To refresh your basic Java skills.
Description: Develop a Java program that creates a standalone GUI application (not an applet) that simulates an e-store which allows the user to add items (books) to a shopping cart and once all items are included, total all costs (including tax), produces an invoice, and append a transaction log file.
Your program development must include the following steps:
1. Create a main GUI containing the following components:
a. An area that allows the user to input data into the application along with the descriptive text that describes each input area.
b. A total of six buttons as shown below with functionality as described below.
c. As illustrated below, the various buttons on the interface are only accessible at certain points during a user’s interaction with the e-store.
2. An input file named “inventory.txt”. This is a comma separated file which contains the data that will be read by the application when the user makes a selection. Each line in this file contains three items; a book id, a quoted string containing the book title and author’s name, and the price for one copy of the book. A sample file is provided for you on WebCourses.
3. An output file (append only) named “transactions.txt” must be created that uniquely logs each user transaction with the e-store. The unique transaction id will be generated as a permutation of the date/time string when the transaction occurred.
Restrictions:
Your source file shall begin with comments containing the following information:
/* Name: <your name goes here> Course: CNT 4714
Assignment title: Program 1 – Event-driven Programming Date: Sunday September 15, 2019
*/
Input Specification: The file “inventory.txt” as described above (see example below as well).
Output Specification: Output is to appear in the specified components of the GUI and various message boxes that appear, plus the contents of the
“transactions.txt” log file that will be generated.
Additional Information:
Shown below are example screen shots of the GUI to help illustrate how your application is to operate.
1. Screen shot of the contents of an example “inventory.txt” file.
3. GUI after user specifies total number of items in the order and makes a selection for item #1.
4. GUI after user has selected the first item and clicked the “Process Item #1” button.
5. When the user clicks on the “Confirm Item #1” button, a confirmation information message appears on the screen.
Item button. This is the only “error” you will need to catch. user pressed the Process User entered an incorrect book ID. This message would be displayed when
Note that the text areas for entering the second item information are cleared and ready for input.
Subtotal should reflect current total of all confirmed items.
Information for previous item remains on display.
7. User enters next item in the order.
8. The GUI after the user has entered the information for all the items and confirmed the last item.
9. When the user clicks the “View Order” button, the following message box should appear.
10. When the user clicks the “Finish Order” button, the invoice message should be generated and displayed.
11. The transaction file after order shown above was finished. Note the unique transaction ids based on the date and time.
12. The transaction file after several orders have been completed. Note the unique transaction ids based on the date and time for every separate transaction. This file shows seven separate transactions.