You are on page 1of 3

CS121 Project Customer Rewards

Client Request
Hi, I own a Muncie business, and Im looking for somebody to help me go through my data to give customer rewards. Id like to reward my top 3 customers who have spent the most money all year, then randomly pick five customers and give them $20 to $100 gift cards. Attached is an Excel spreadsheet of exported data from my ecommerce store in 2011. I want a program that I can use every year and simply plug in the filename and have it produce a file with the above results, along with a sorted list of customers. Can anyone help? Brian Richardson Maxwells Camera Shop

Client Clarification
Below are questions you should ask a client based on his request above; my answers follow. How much do we reward the top 3 customers? Show their names, emails, # transactions, and total transaction amount, then I'll decide how much they should receive after my budget settles in May. What data should we show for the 5 gift card winners? Names and emails are fine, I can look them up in my CRM, if I need more. Are the amounts from $20 to $100 random? No, I want to give 5 gift cards: 20, 40, 60, 80, and 100 dollars. You tell me who gets which one. How should we sort the list of customers? Sort by those who spent the most at the bottom. See output.txt for the fields to show. Export in tabulated columns so I can easily import back into Excel. How do you want to "plug in" the file name every year? I want to run this easily on the command-line. Give me instructions.

Last Updated: 3/18/2014 2:36 PM by James Hueston

Page 1 of 3

CS121 Project Customer Rewards

Methodological Requirement
You must execute this 1 below to get any credit; failure to execute this 1 results in a score of zero. Write a java program that uses one or more previously studied user-defined data structures to store, search, sort, and manipulate the data. Note that you may modify implementations or add methods to these user-defined structures as needed to achieve the results, which is the purpose of such flexibility. No use of Java Collections API or 3rd party library for the purpose of exercising your ability to use/manipulate user-defined data structures.

Evaluation
See the rubric in Blackboard for point distribution, Produce appropriate output for each of the three main tasks. Write results to output.txt with the same fields/format as my posted output.txt. Keep your Customer object separate from your RewardsDistributor for good OO. Follow good practices already demonstrated: custom package(s) in reverse domain notation, naming conventions (ie. camelCase), meaningful names, no build errors, no warnings.

Extra Credit
1. 5% - Deliver 8 unique results (ie. 5 gift card winners mutually exclusive from top 3 spenders) by writing code to produce two mutually exclusive sets. 2. 2% - Accumulate total transaction values if a customer has more than one transaction. 3. 3% - If there are more than 3 top spenders with the same amount, produce the 3 whose transaction dates were earliest (sooner in the year). Any attempt at extra credit must be labeled with a comment in your code using the following format: //EC X Description where X is the # above youre attempting, and a short description

Submission
Follow BB -> getBetter() -> Eclipse Tips -> Export Archive (for all our Projects) Failure to export correctly results in 10% reduction in the project grade Submit your code in the Blackboard item where you downloaded this file.

Resources
File I/O Java Tutorials: Basic I/O Data Structures, Searching / Sorting see files provided, authors slides, your notes

Objectives
Upon completion of this project, you should be able to: Clarify a clients loose requirements and formulate a specification Design, implement, and evaluate a program that satisfies the requirements Parse external data files into user-defined data structures (1 DS7) Sort a collection and manipulate data from one location to another and customize output Write results to an output file

Last Updated: 3/18/2014 2:36 PM by James Hueston

Page 2 of 3

CS121 Project Customer Rewards

Tips
Use the Console for debugging before writing to file, since Console is an output stream written in similar manner as files. Increase buffer size of the console to show more output: o Eclipse -> Window -> Preferences -> Run/Debug -> Console o Uncheck Limit console output OR update Console buffer size to 1,000,000 (~ 1MB text) o While there, change the Displayed tab width to 15 to better accommodate our data. Open Output.txt o Right-click the editor window -> Preferences -> Displayed Tab Width: 15 to better accommodate data in the editor window. Consider the UML diagram below for good OO; though your design may differ:

Here's one way (but not the only way) you can divide up this project. Your data structure will likely implement an interface, and depending on the structure you choose, you may need the Searching and Sorting classes we introduced. For your domain model, it would be good to have a Customer class, and separately, a parser that reads lines from your input file and properly generates Customer objects. Then, you'll put those customer objects in your user-defined structure. Your driver, where main() exists, could contain all procedures necessary to execute the client's main requests, but I suggest subdividing each task into its own method instead of having one bulky main. On the other hand, separating tasks into their own files may be more overhead than its worth since you're appending to the same file with short routines; you decide! Last Updated: 3/18/2014 2:36 PM by James Hueston Page 3 of 3