Question Description

I’m trying to study for my Programming course and I need some help to understand this question.

You will reuse some of the code developed in the earlier projects to implement a sophisticated Swing application that allows a user to enter and analyze sales representative data.

GUI requirements:

The Swing application will provide a GUI that allows a user to enter the following data items:

  1. Sales representative ID
  2. Sales representative First Name
  3. Sales representative Last Name
  4. Total sold for each of three categories: office supplies, books, and paper
  5. Sales district (North, South, East, West)
  6. Preferred means of contact with potential buyers (phone, e-mail, visit)

The Swing application will contain the appropriate GUI components to enter the sales information and provide buttons QUIT, ENTER, EVALUATE, and DISPLAY.

QUIT Button Requirements:

Provide a QUIT button to exit the application.

ENTER Button Requirements:

Create an ENTER button that causes the sales representative’s data to be retrieved from the GUI components and submitted to the application. Each time the ENTER button is pressed, the data will be written to the file. Name the output file salesrep.txt.

Write the data in the following format to a text file, using white spaces as the delimiter. Include the categories (SUPPLIES, BOOKS, PAPER) in your file to label the dollar amount sold for each category. Sales district entered should be converted to upper case (NORTH, SOUTH, EAST, WEST). Independent line separators should be used in the output file. Code for the ENTER button should be well commented.

Format of your output file, salesrep.txt:

salesRepID firstName lastName SUPPLIES totalAmountSuppliesSold BOOKS totalAmountBooksSold PAPER totalAmountPaperSold district contactMeans

Example output file contents:

1001 Jennifer Ward SUPPLIES 2140.20 BOOKS 5200.10 PAPER 455.23 NORTH Phone
1003 Athena Andrews SUPPLIES 5155.55 BOOKS 6300.50 PAPER 223.25 SOUTH Email

Each time the ENTER button is pressed, the application should append a new line to the file, salesrep.txt. When the application starts, the file should be opened for appending. This file is to keep a running history of the entered data.

EVALUATE Button Requirements:

Provide an EVALUATE button. Each time the EVALUATE button is selected, the sales representative data will be read from the output file, salesrep.txt, that was created and the amounts sold in SUPPLIES, BOOKS, and PAPER will be totaled. If the amount sold on all three categories is greater than or equal to (>=) $8,000, write the sales representative data to a new file stars.txt. These sales representatives will receive a bonus to demonstrate your company’s appreciation for a job well done.

Your stars.txt file should not be opened for appending each time the application is run. Independent line separators should be used in the output file. Code should be well commented.

An example of the format of your stars.txt file:

salesrepID firstName lastName SUPPLIES totalAmountSuppliesSold BOOKS totalAmountBooksSold PAPER totalAmountPaperSold district contactMeans

DISPLAY Button Requirements:

Create a DISPLAY button. When this button is selected, the stars.txt file will be read in and displayed. Create a Sales Representative class that stores sales representative information. A Sales Representative object will be created for each sales representative that is read in when the DISPLAY button is selected. Select appropriate attributes for your Sales Representative. Ensure that you have created appropriate constructor(s) that will allow you to create sales representatives with the values read in from the file for sales rep ID, sales rep first name, sales rep last name, and so on.

With each Sales Representative that is read in from your stars.txt input file, you will create a Representative object that holds the sales representative data and add each Representative object to an ArrayList. Do not store your sales representative information as a String and add this String into your ArrayList. You must use your Representative class to create Representative objects. You should store Representative objects that encapsulate your sales representative information and store these in your ArrayList.

Hint: You may want to look into overriding toString() method to provide a readable string representation of Representative object.

After the ArrayList has been created, this ArrayList will be iterated over and displayed to the jTextArea. Override the toString() method for your Representative class so that each sales representative is printed in a readable manner. Total sales representatives should also be displayed.

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at essayloop.com

Do you have a similar assignment and would want someone to complete it for you? Click on the ORDER NOW option to get instant services at essayloop.com. We assure you of a well written and plagiarism free papers delivered within your specified deadline.