Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
hard

Museum Application Testing

Mark
< Prev
Next >

A museum’s digital collection application uses the following pseudocode to determine if an artifact should be displayed in the ‘Featured’ section. An artifact is featured if it is older than 500 years OR if it has been viewed more than 1000 times. However, artifacts that are currently on loan to other museums cannot be featured, regardless of age or views.

IF ((age > 500) OR (views > 1000))
{
IF (onLoan == false)
{
DISPLAY(“Featured”)
}
ELSE
{
DISPLAY(“Not Featured”)
}
}
ELSE
{
DISPLAY(“Not Featured”)
}

Which of the following sets of test cases covers all three distinct branches of the supplied pseudocode?

A

Test 1: age = 600, views = 500, onLoan = false. Test 2: age = 400, views = 1500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.

B

Test 1: age = 400, views = 500, onLoan = false. Test 2: age = 400, views = 500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.

C

Test 1: age = 600, views = 1500, onLoan = false. Test 2: age = 400, views = 500, onLoan = true. Test 3: age = 300, views = 500, onLoan = false.

D

Test 1: age = 600, views = 500, onLoan = false. Test 2: age = 600, views = 500, onLoan = true. Test 3: age = 400, views = 1500, onLoan = false.

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

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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