5
0/15

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]

Develop code Questions

Practise Edexcel GCSE Computer Science Develop code with exam-style questions for GCSE Computer Science. 57 questions 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, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.

PreviousNext

Develop code Questions

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