Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
hard Solved by 6 students

Primality Function Logical Error

Mark
< Prev
Next >

A function is designed to determine if a number is prime. Testing shows that it correctly identifies 2, 3, 5, and 7 as prime, but it incorrectly identifies 9 as prime and 11 as not prime. Based on these test results, which of the following statements most likely describes a logical flaw in the function’s algorithm?

A

Only odd divisors greater than 3 are skipped by the function.

B

It returns true if a number is not divisible by 2 or 3 only.

C

The function rejects all numbers above 7 regardless of tests.

D

It does not check divisibility by all possible numbers up to the square root.

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1jdvillalta86522 0m 54s 146
#2jasonvikathompson11 0m 16s 84
#3djy18102322 3m 26s -6
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|