Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.

Project 1: Finding Prime Numbers

Due Dates

Thursday, March 15, at 6:00 PM
Hardcopy showing pseudocode for the program you are going to write.
Monday, March 19, at 9:00 AM:
The finished Scilab code.

Instructor's solution: count_primes.sci

It might help some of you to see a program which looks for odd numbers between two bounds. Looking for prime numbers takes more work, but perhaps this will help you to start.

Your job in this assignment is to write a function which finds all the prime numbers in some range of integers. The function must

The declaration of the function should look like this:

    function primes_between = count_primes(lower_bound, upper_bound)

Please document your function so that other people can understand what it does, and how it does it. Part of the grade for this assignment -- and all assignments -- will be based on the internal documentation of the program. When in doubt, pretend that you are going to mail the program to your favorite high-school math teacher. He or she should be able to understand everything (including motivation and any limitations) simply by reading the source code.

Bells and Whistles

You may go the extra mile in this project by implementing any of the following:


This page maintained by Michael Richmond. Last modified Mar 6, 2007.

Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.