A shop sells sandwiches and snacks. The owner chooses a 'daily special' sandwich which is displayed on a board outside the shop. Each 'daily special' has two different fillings and is made with one type of bread. The owner wants a program to randomly choose the 'daily special' sandwich. The program designer decides to store the possible sandwich fillings in a 1D array of type string. The array is declared in pseudocode as shown: DECLARE Filling : ARRAY [1:35] OF STRING Each element contains the name of one filling. An example of the first five elements is as follows: | Index | Element value | |-------|-----------------| | 1 | "Cheese" | | 2 | "Onion" | | 3 | "Salmon" | | 4 | "Anchovies" | | 5 | "Peanut Butter" | A second 1D array stores the possible bread used: DECLARE Bread : ARRAY [1:10] OF STRING Each element contains the name of one type of bread. An example of the first three elements is as follows: | Index | Element value | |-------|---------------| | 1 | "White" | | 2 | "Brown" | | 3 | "Pitta" | Both arrays may contain unused elements. The value of these will be an empty string and they may occur anywhere in each array. A procedure Special() will output a message giving the 'daily special' sandwich made from two randomly selected different fillings and one randomly selected bread. Unused array elements must not be used when creating the 'daily special' sandwich. Using the above examples, the output could be: "The daily special is Cheese and Onion on Brown bread."
✓ Correct Answer
The correct answer is —. This question tests the candidate's understanding of programming constructs & algorithms within the Computer Sciencesyllabus. The examiner's mark scheme requires...
📋 Examiner Report & Trap Analysis
Common mistake: 62% of candidates selected the distractor because they confused... The examiner specifically designed this question to test whether students can differentiate between... To secure full marks, candidates must demonstrate...
Unlock the Examiner's Answer
Sign up for free to reveal the correct answer, the official mark scheme breakdown, and the examiner trap analysis for this question.
Sign Up Free to Unlock →Join thousands of Cambridge students already using Oracle Prep