CSE3221 (Summer 2013) Assignment #1

 

You have to work individually. You are not allowed to view or exchange documents with your peers. We treat all sorts of cheating very seriously. Do not copy code from anywhere, even as a `template''. No late submission will be accepted. Your work will be graded based on: i) correctness of programming logic; ii) clarity of your code and your coding style; iii) whether your code follows the specification. It is your responsibility to explain clearly every detail you do in the code with appropriate comments to avoid any possible confusion in marking.

 

This assignment is due 19:00, June 19, 2013.

 

You are required to process several data sets to calculate the overall mean of all data samples. Each data sample is a floating-point number. Each data set consists of many data samples and each data set is stored in a file. The file format is that all data samples in this data set are separated by whitespace in the file.  As example, we have posted three data sets on the course Web: dataset1, dataset2, dataset3, for your reference. However, your program should be able to process any number of data sets.

 

 

 

Your programs should compile as follows:

 

cc –o prs process.c

cc –o thr thread.c –lpthread

 

And the programs should run as follows (all datasets are provided as command line arguments):

 

prs dataset1 dataset2 dataset3

thr dataset1 dataset2 dataset3

 

What to submit?

 

Submit two C programs using the following commands:

 

submit 3221 a1 process.c

 

submit 3221 a1 thread.c