Tom Kelliher, CS 245
Sept. 23, 2002
Class diagrams and use case diagrams due Wednesday.
Read SE Chapter 4.
Unix Lab II.
Product design.
When starting out, the most important command: man. As in:
\
.
ls -aCF ls -a -C -F ~kelliher/pub ls -l ~ cat Class/Cs245/Exams/evil.tex w | grep sabbott kill `ps gaxuw | grep sabbott | awk '{ print $2 }'` javac Prog.java java Prog < input > output rm * rm -i * alias rm 'rm -i' less .cshrc .login
Write a Java application to solve the following problem.
The sieve of Eratosthenes is one of the earliest algorithms for generating prime numbers between 2 and n. It works as follows. Using an array with a maximum index of n, mark all numbers as being prime ( array[i] is the indication that the number i is prime or non-prime). Mark all numbers which are multiples of two as being non-prime. Repeat for three, four, , . Finally, print all numbers which are still marked as prime.Write a program which prints the primes less than or equal to 100.