Skip to content

Course home

Sign up

Develop code

EasyMediumHard
123456789101112131415
Question 12

A program is required to manage the retrieval of secure chemical samples from a laboratory vault. The sample identifiers and their corresponding safety clearance codes are stored in a two-dimensional array named vault_samples.

Write a program in Python to meet these requirements.

Inputs

  • Prompt for and accept a sample ID and a safety clearance code.
  • Neither input should be left blank (you must validate this using appropriate loops).

Process

  • Implement a search by iterating through the 2D array vault_samples to find the sample ID and its corresponding clearance code.
  • Ensure the search works correctly for a vault_samples array of any length.

Output

  • Display a successful dispatch message (e.g. "Access granted. Dispensing sample.") when both the correct sample ID and clearance code are found.
  • Display a suitable safety/security alert message when the sample ID is found but the clearance code does not match.
  • Display a suitable error message when the sample ID cannot be found in the database registry.

Use comments, white space, and logical layouts to make the program easy to read and understand.

[15]
Markscheme

Develop code Questions

  1. GCSE
  2. /Computer Science
  3. /Develop code

51 exam-style questions on Edexcel GCSE Computer Science Develop code, covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank