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

Museum Collection Peer Review

Mark
< Prev
Next >

A developer is creating a digital catalog for a small museum. The program currently allows users to search for artifacts by entering a year. If the year matches an artifact’s creation date, the program displays the artifact’s name and a short description.

During a peer review, a colleague notes: “The search function works when I type ‘1920’, but when I type ‘1920s’ or ‘early 20th century’, the program crashes instead of showing an error message or returning zero results.”

Which concrete action best addresses the peer review comment while satisfying the requirement to handle unexpected inputs gracefully?

A

Write a comment in the code explaining that users should only enter numerical years when using the search function.

B

Modify the search function to check if the input is a valid number before attempting the search, displaying a “Please enter a valid year” message if it is not.

C

Update the museum’s database so that every artifact includes tags for decades and centuries, allowing the current search function to find them.

D

Add a feature that automatically converts any text input into the closest valid year before searching.

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|