Skip to content

Course home

Sign up

Develop code

EasyMediumHard
123456789101112131415
Question 1

A program is required to manage guest check-ins for a hotel. The names of the guests and their booking confirmation codes are stored in a two-dimensional array named bookings.

Write a program in Python to meet these requirements.

Inputs

  • Prompt for and accept a guest name and a confirmation code.
  • Neither input should be left blank (you must validate this using appropriate loops).

Process

  • Implement a search by iterating through the 2D array to find the guest's name and their corresponding confirmation code.
  • Ensure the search works correctly for a bookings array of any length.

Output

  • Display a successful check-in message when both the correct guest name and confirmation code are found.
  • Display a suitable error message when the guest name is found but the confirmation code does not match.
  • Display a suitable error message when the guest name cannot be found in the database.

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