Event-Driven Programming solution

$35.00 $30.80


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:


  1. An area that allows the user to input data into the application along with the descriptive text that describes each input area.
  2. A total of six buttons as shown below with functionality as described below.
  3. As illustrated below, the various buttons on the interface are only accessible at certain points during a user’s interaction with the e-store.
  1. An input file named “txt”. This is a comma separated file which contains the data that will be read by the application when the user makes a selection. A sample file is provided for you on WebCourses.


  1. An output file (append only) named “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.



Your source file shall begin with comments containing the following information:


/* Name: <your name goes here>

Course: CNT 4714 – Fall 2017

Assignment title: Program 1 – Event-driven Programming

Date: Sunday September 10, 2017



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.



  • Submit a working copy of your source code (all .java files) via WebCourses no later than 11:59pm Sunday September 10, 2017.


Page 1


  • Include a file that contains screen shots, similar to those illustrated below, that shows your application in action as a user interacts with your e-store to purchase books.
  • Include a screen shot of your “transactions.txt”file showing at least the last few transactions (similar to the one shown on the last page of this document).


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.























































Page 2



an order –

  1. Initial GUI: generates

invoice and

adds to

















            Note that these    
Allows for   Confirms that        
      buttons are not   Clears
processing an        
  the item is     initially “active”.   order and
item once it is        
  correct.         starts over.
      View the        
      order so far.        



  1. GUI after user specifies total number of items in the order and makes a selection for item #1.



































Page 3


  1. GUI after user has selected the first item and clicked the “Process Item #1” button.












    Information on the book
Note that the “Confirm
  purchased has been
Item #1” button is now   extracted from the
active and the “Process   inventory file and written
Item #1” button is inactive.   into the window on the
    line for item #1.


  1. When the user clicks on the “Confirm Item #1” button, a confirmation information message appears on the screen.













User entered an incorrect

book ID. This message

would be displayed when


user preseed the Process


Item button.


















Page 4


6. The main GUI after the user has confirmed the first item.   Discount is
  1-4 = 0%
      5-9 = 10%
      10-14 = 15%
Note that     >=15 = 20%
the button        









Note that the text areas

for entering the second

item information are

cleared and ready for







  1. User enters next item in the order.




































Page 5







    for previous
Subtotal should  
  item remains
reflect current  
  on display.
total of all  
confirmed items.    


  1. The GUI after the user has entered the information for all the items and confirmed the last item.




















  1. When the user clicks the “View Order” button, the following message box should appear.

















































Page 6


  1. When the user clicks the “Finish Order” button, the invoice message should be generated and displayed.



The date and time are used

to create the unique

transaction id in the

“transactions.txt” file.

Format is “DD/MM/YY































  1. The transaction file after order shown above was finished. Note the unique transaction ids based on the date and time.


















The last transaction occurred on

8/21/2017 at 15:09:08 pm. See the

invoice message above. Permutation





Page 7


  1. The transaction file after several orders have been completed. Note the unique transaction ids based on the date and time for every separate transaction.



































































Page 8



































































Page 9