Page limit the tests carried out the program
Requirements
Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format (2 lines per entry). The program must then read in information about past sales transactions and output all the products to a new file, sorted by product description, along with their sales rank and the five other products with which they were most commonly purchased.
l Line 1 contains the product id, which is a string of 13 digits
l Product IDs are unique
<Product Description> (A text string)
For example:
1299128391283
Eggs, Extra Large, Barn laid
l Receipt numbers are unique
l Line 2 has the format Number of items: <number of items> where <number of items> is a positive integer
Receipt number: <ReceiptNumber> (<ReceiptNumber> is an integer)
Number of items: <NumberItems> (<NumberItems> is an integer)
Number of items: 3
1234567890123
9832983102938
1234567890123
l The program lists the products in an output file, sorted by sale transaction count, in decreasing order.
l When there is a tie in the sale transaction count, the products are listed in alphabetical order of their descriptions (see example below)
ID: <ProductID>
Sales Count: <SalesCount>
4: (<ProductID>) - <Product Description>
5: (<ProductID>) - <Product Description>
This product was purchased most often with:
1: (1299128391283) Eggs, Extra Large, Barn laid [8]
6: (0002011106917) Nuts, almonds, dry roasted [4]
Product: Pork - cured, ham, separable fat, boneless
“Sales count” is the number of transactions that a product appears in. The numbers in square brackets are the number of transactions a product appears with another product
Calculating the most frequent items purchased with a product: With every product, we need to output the 5 other items with which it was most frequently purchased. These other items must be listed in order of frequency. The item listed at position 1 would have been bought more frequently with the item than the item at position 2, and so on. Though we are interested in the “top 5”, the list may have more than five items due to ties. In that case, more than five items are to be included and items involved in a tie are to be ordered by product description. If a product has not been bought with 5 other items, then less than 5 items are output.
When a particular line does not conform, as expected, to the description given above,
● the error should be detected
● no result is output, i.e. the product output file (the third command-line-argument) is empty.
● and the program terminates
3. Product ID is not unique
For sales transaction file:
5. Product ID does not consists of 13 digits
6. Product ID in a sale transaction has duplicates
ERROR: <Error Name>
<Error Description>
The program is terminated
You can assume that in the sales transaction file
Execution of the Program
The program will be run with the following command:
·How the program works.
You should focus on the data structures and algorithms used. Include in your discussion a comparison of at least three data structures/algorithms you considered using to solve the problem. (3 page limit)