CS101 - Homework 9: Data Analysis
Section 001: 55 points
Section 002: 45 points
Answer the questions stated in the following exercises by submitting plain-text or Java source code (.txt and .java extensions respectively) as stated in the exercises through NYU Classes. No word (.doc/.docx/etc.) or rich-text (.rtf) files please (in your text editor do "Save file as plain-text"). Java programs should be just the Java source code (not your .class files or Eclipse workspaces) unless otherwise stated.
In all files submitted include a documentation header using comments which include:
* [Description of the class file]
* @author: [Your Name]
Points will be deducted for bad coding style (up to 25% of your grade), so:
- use good variable/function names (self-documenting code)
- avoid hardcoding values
- provide comments for complex code blocks
- all methods and classes should include javadocs
For more details regarding good coding style guidelines see the grading criteria.
This assignment is broken into two parts.
- Part 1: Data Mining and Data Analysis
- Part 2: Recursive Graphics
Part 1: Data Mining and Data Analysis
Regular students: 30 points
Honors students: 40 points
Today more data is available than in any other time in the history of the world, and the amount of data being produced and collected is growing every day. Almost every organization is doing some form of data mining or data analysis. NYC Open Data provides a vast quantity of freely and publicly accessible data that we can use to do data mining and data analysis on.
Your Job: Choose a tabular data set from NYC Open Data and allow a user of your program to do some basic data mining on it.
Note: You are free to massage the data before using it as input to your program.
Hint: You can download data from NYC Open Data in a CSV (Comma-Separated Values) format by clicking on the "Export" link and "Download as".
Example session (user input is in bold):
Welcome to the Campaign Contribution Finder App.
This app mines data from:
We show you individual contributors to any candidate for public office, and how much they gave.
Please enter a candidate's first and last name: Anthony Weiner
Found 1,233 contributors to Anthony Weiner's campaign. Showing results 1-10:
Andrea, Mary, $2,100
Asher, Mein, $21
Butter, Kyle, $299
Fisher, Joel, $36
Gangi, Roy, $1
Katz, Harry, $984
Lau, Julia, $50
Pagani, Marcos, $841
Russo, Nicholas, $10
Zelik, Moshe, $2
...hit enter to see the next 10...
Minimum Requirements for Regular Students
- Use a data set with at least 100 rows of data.
- Store the data used by your program in an external text file.
- When your program pulls the data from the text file, convert it into an ArrayList of some kind.
- Allow the user to mine this data in at least one way, as in the example above.
- Output clear instructions to the user on how to use the program and what to expect in terms of output.
- Comments in the code must indicate the URL of the public data used, as well as the specific columns used.
Minimum Requirements for Honors Students (Section 1 of the course)
Honors: 10 points
Some extra credit may be awarded for regular students, or honors students who complete multiple parts of this section
- Meet all the requirements for the regular students (above)
- Add some signifcant additions to your program. For example, consider adding some of these optional features or come up with you own signifcant additions (and document your additions in your program header):
- Support 3 different types of data queries. In the campaign contribution example above, this could be achieved by adding the following additional functionality:
- allow the user to search by contributor name
- allow the user to enter a a minimum and maximum dollar contributions to display
- Present some amount of data in a graphical form (be it a pie chart, bar graph, line graph, etc.). In this case no 3rd party libraries besides Processing libraries are allowed.
- Add animation to your presentation of the information (hint: use millis() to determine how much to display during each call to draw())
- Provide a graphical interface to get the user requested information (hint: use a JOptionPane)
Part 2: Recursive Graphics
15+ points (extra credit awarded for impressive or original designs)
Write a Processing based program that will draw graphics using a recursive algorithm to the screen. Your algorithm should differ signficantly from ones we used in class (e.g. if we draw recursive squares in class, do not draw recursive squares and your base conditions must differ from the ones used in class).
There are lots of good ideas:
- Google Image Search for examples
- Take an image file, scale it, translate it, and redraw it
- Modify your drawObjects project to draw things recursively
- Take a basic shape and do some warping of the object based on recursion (e.g. an ellipse gets more and more elongated)
Extra credit ideas:
- Use animation during your drawing
- Use 3D objects for your graphics
Hint: Always approach your base case!
Submit the following items on NYU Classes:
- The main driver for Part 1 needs to be called "NYCData.java".
- The main driver for Part 2 needs to be called "Picaso.java".
- Attach all other resource files needed by your programs including your NYC Open Data text file used. And any supplemental .jar files you may have used besides the standard core.jar file. If you have several resource files, you can feel free to compress the files into a ZIP file or a JAR and submit them that way. Include a README.txt file if instructions for running the files is necessary.
Acknowledgements: Part 1 of this assignment is based on work done by Amos Bloomberg