CS 2213 Advanced Programming, Fall 2000 Lab Assignment 1


Due Thursday, September 14, 2000

Lab Assignment 1 has 3 parts.


Part 0:
If you have not already done so, make a directory for this course. Make a subdirectory called lab01. All files related to this lab should be kept in this directory. Get the files related to the sieve calculation of primes and put them in this directory. These files are in /usr/local/courses/cs2213/fall2000/sieve. To get the files, start in your lab01 directory an execute:
cp /usr/local/courses/cs2213/fall2000/sieve/* .
Use make to compile the programs and make sure they are working correctly. Run lint an make sure you understand any warning messages generated.

In this assignment you will be modifying sievemain but will not modify sieve.c.

Part 1:
Copy sievemain.c into sievemain1.c and modify it so that it displays your name instead of mine. Modify the makefile so that it also compiles, lints, and cleans sievemain1.

Part 2
Copy sievemain1.c into sievemain2.c Modify the makefile so that it also compiles, lints, and cleans sievemain2.

Now modify sievemain2 so that it displays the size of the array used, the number of primes calculated and the sum of the primes calculated instead of the primes themselves. Your program should now produce only 2 lines of output, one containing your name and the other containing the rest of the information.

Run lint and make sure that there are no new warnings generated.

Change the size of the array to 15. Run the program and check by hand that it gave the correct answers.

Now change the size of the array to 10,000. Run the program again. Use cut and paste to put the output into a mail message sent to cs2213. The mail message must have the subject line:
cs 2213 lab assignment 1 results
Be sure that you use cut and paste. Do not send your results as an attachment which assumes a particular type of mail reader.

Do not send this email before Friday, September 8.