
iammankani
New User
Jan 23, 2014, 12:11 PM
Post #1 of 4
(34506 views)
|
The code should be written in Perl should be commented appropriately. The solution should be executable, portable and should not have any undefined functions. Use of standard libraries is fine. The solution will be judged on efficiency, portability, readability and completeness. The BANK keeps track of the customer spending behavior by categorizing the purchases into pre-defined categories like groceries, entertainment and fuel. There are no other categories to consider for this task The log recorded by the software is in the following format: Customer name|category|amount A reference file has been provided below to test out the code. Write a program/script to parse this information and 1. Generate a report(output file) total amount spent by each customer 2. Generate a report (output file) listing their spending in each category 3. Generate a report (output file) by sorting the list of customers based on highest spenders in each category (groceries, fuel, tobacco-liquor) Here an example of a log file. Example: Veena |groceries|$1.75 Tim|entertainment$5.00 Jane|groceries|$5.50 Vinh|fuel|$4.75 Jane|entertainment|$8.70 Vinh|fuel|$60.90 Tim|entertainment|$12.80 Veena|fuel|$55 Tim|groceries|$15 Sample output for first question should look something like this: Total amount spent by each Customer: Veena:$56.75 Vinh: $ 65.65 Jane: $ 14.20 Tim: $ 32.8
|