Data Analysis Project
This assignment is designed to give you practice with program design, control and data structures, and files.
The Project
In this assignment, you will create an interactive program for data analysis. The program should ask the
user whether the data will be entered d irectly or from a file. If entered d irectly the program will read one
number per line unt il a blank line is en tered. If from a file, the program w ill prompt the user for the name
of a file that contains a set of numbers , one number per line. The program should open the file and read the
data from the file into a list. Be sure to check to see if the file exists and respond accordingly. While the
number of entries in the file is unspecified, you may assu me the file is well formed.
Once you have read in the data, your program should sort it. Once sorted, your program should display
summary statistics including the number of items in th e file, the largest thr ee items in the d ata, the smallest
three items in the d ata, and the mean, the median, and the mode for the data. (If there are multiple modes,
you need only report one, but it would be better to not e that fact.)
Finally your program should give the user the option of writing the sorted data to a new file. Ask the user
whether they want the data sorted as cending or descending and proceed accordingly. If the user wishes to
save the data, the program should read in a new file na me, test to see if the file exists, respond accordingly,
and then write the data to the new file.
Finally, the program should give the user the option of processing more da ta.
Pair Programming
For this assignment, you will work in pairs. Please find someone you haven’t worked with before. Your
pair (team) will submit one program and you will each receive the same grade.
What to Hand In
1. Turn in all code files used for your project by attaching the files to an em ail. This should be done by
the start of class on the project due da te, one copy per team. Be sure to k eep archival cop ies.
2. At the start of class on the due date, turn in one copy per pair of the printout of sample output.
3. Each of you should also turn in the answers to the following questions.
Questions
Answer the follow ing questions and turn in your answers with your program.
1. How much time did you spend planning before you s tarted coding?
2. How much time did you spend coding?
3. How much time did it take to correct the errors in your program?
4. What problems did you have getting your code to work?
5. How did pair-programming work for you? What worked well? What problems did you hav e?
Grading
The program will be graded on the following basis:
1. Error-free. The program should run without errors.
2. Documentation. The main program and every function should be properly documented . The comment
for the main program should include your name, the d ate, and a brief d escription of what the program
does. Each function should include a comment that includes a brief de scription of what the function
does. Each function should also include a comment listing preconditions and post conditions .
3. Programming style. Did you use appropriate indenta tion and white space?
4. Completeness and correctness. Does your program fulfill all the requirements of the assignment
correctly? Did you turn in everything including the questions?