一:(a)
对于图中表示的细节:
1:int curPrime....curPrime=2
2~3:numPrimes<n
3:curPrime++;isPrime=true;
4:int i=0
5~6:i<=numPrimes-1
6~7:curPrime%primes[i]==0(T)
6~8:curPrime%primes[i]==0(F)
7:isPrime=false;break;
8:i++
5~9:i>numPrimes-1
9~10:isPrime(T)
9~11:isPrime(F)
2~12:numPrimes>=n
12:int i=0
13~14:i<=numPrimes-1
14:system.out.println..
15:i++
13~16:i>numPrimes-1
(b) set MAXPRIMES=4, then t2 will get the resulting array bounds error
(c)n=1
(d)NC:TR={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
EC:TR={(1,2),(2,3),(2,12),(3,4),(4,5),(5,6),(6,7),(6,8),(7,9),(8,5),(5,9),(9,10),(9,11),(10,11),(11,2),(12,13),(13,14),(13,16),(14,15),(15,13)}
PPC:{(1,2,3,4,5,6,8),(1,2,3,4,5,6,7,9,10,11),(1,2,3,4,5,6,7,9,11),(1,2,3,4,5,9,10,11),(1,2,3,4,5,9,11),(5,6,8,5),(6,8,5,6),(1,2,12,13,16),(1,2,12,13,14,15),{14,15,13,16),(13,14,15,13),(14,15,13,14),(15,13,14,15),(3,4,5,6,7,9,10,11,2,12,13,16),(3,4,5,6,7,9,10,11,2,12,13,14,15),(3,4,5,9,10,11,2,12,13,16),(3,4,5,6,7,9,11,2,12,13,14,15),(3,4,5,9,11,2,12,13,16),(3,4,5,9,10,11,2,12,13,14,15),(8,5,6,8),(6,8,5,9,10,11,2,12,13,14,15),(6,8,5,9,10,11,2,12,13,16),(6,8,5,9,11,2,12,13,14,15),(6,8,5,9,11,2,12,13,16),(8,5,6,7,9,10,11,2,12,13,14,15),(8,5,6,7,9,10,11,2,12,13,15),(8,5,6,7,9,11,2,12,13,14,15),(8,5,6,7,9,11,2,12,13,15),(2,3,4,5,6,7,9,10,11,2),(2,3,4,5,6,8,9,11,2),(2,3,4,5,9,10,11,2),(2,3,4,5,9,11,2)}
(e)[1,2,3,4,5,6,8,5,6,7,9,10,11,2,12,13,14,15,13,16]
(f)[1,2,3,4,5,6,8,5,6,7,9,10,11,2,12,13,14,15,13,16],[1,2,3,4,5,9,11,2,12,13,16]
二:基于Junit及Eclemma实现