Question
Asked by:
mityguy23
mityguy23
Rating : No Rating
Questions Asked: 42
Tutorials Posted: 0
 

$13.00 java help homwork

Q:
Develop an application that will read and process customer history order information from an input text file, to determine total spent for each customer. The application will print a report of all customers and the total each spent. The report will be ordered by customer id.

Each record of the text file contains a customer ID, order number, and total of order. An example customer order file:

10051 1234567 150.00
10052 1234568 200.00
10051 1234569 120.00

Customer id should be the first field, order number should be the second field, and the amount of the order in dollars and cents (no commas) should be the third field. White spaces (no commas) should be used as the delimiter between each field and each customer order record should be in a separate line. Your file may be used as input to a future application which is why the format is important.

The file can contain several entries for the same customer ID. Your application should accumulate the total spent for each customer as you read the order information from the file. The application should print total spent for each customer to the screen using natural ordering of the customer id.

Refer to the various Lists, Sets, Maps, and Queues provide by the Sun Java API. Determine which data structure provided by the Java APIwould be the best choice for your application. Your grade will be based on your use of the class selected and your ability to select the most appropriate class to use based on the stated requirements.

Write an application that will satisfy the assignment requirements and test that it works. For your discussion essay, explain in 1-2 paragraphs the class you chose to use and your reasons for your choice.

The output to the screen should be in the following format:

10051 270.00
10052 200.00

Each customer's information should be on a separate line with customer id and total spent printed for each. Your customer information should be ordered by customer id starting with the lowest customer id and ending with the highest.

 


   
   
   
   
 
Available Tutorials to this Question
Posted by:
modulo51
modulo51
Rating (110): A-
Questions Asked: 1
Tutorials Posted: 353, earned $2,117.64
 

$13.00 Java: CustomerHistoryProcessing, Scanner input, SortedMap<key,value>, StringTokenizer, UseNotes, consoleOutput.htm

  • This tutorial was purchased 3 times and hasn't been rated yet.
  • Posted on Aug. 02, 2009 at 12:30:29AM
A:
Preview: ... quot;\\\\n Processing transaction file:");<br> int count = 0;<br> while (inStream.hasNext()) {<br> count++;<br> String line = inStream.nextLine();<br> System.out.print(<br> String.format(" %3d) ", count) + String.format("%-20s", line));<br> // tlkens are strings separated by 1 or moree spaces:<br> StringTokenizer strTokz = new StringTokenizer(line, " ");<br> try {<br> int id = Integer.parseInt(strTokz.nextToken());<br> strTokz.nextToken(); // neglect this field<br> double amount = Double.parseDouble(strTokz.nextToken());<br><br> if (sort ...

The full tutorial is about 1356 words long plus attachments.

Attachments:
CustomerHistory.java (3K) (Preview)
CustomerHistoryUseNotes.txt (4K) (Preview)
consoleOutput.txt (1K) (Preview)
CustomerHistoryZipped.zip (21K)
Posted by:
rawfile
rawfile
Rating (1): A+
Questions Asked: 0
Tutorials Posted: 2, earned $3.59
 

$8.00 NetBeans Project with Customer Information file & Reasons for the class used

  • This tutorial hasn't been purchased yet.
  • Posted on Aug 03, 2009 at 2:14:34PM
A:
Preview: ... proper execution of the application.<br><br>The class that was used was ...

The full tutorial is about 58 words long plus attachments.

Attachments:
CustomerHistory.zip (14K)
Reasons for the class used.txt (1K) (Preview)
   
Join Now or Log In
Get Tutoring
Get Paid
Academic Honesty