ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
7 marks · Data types and structures
The user interface is shown below. TRUE FALSE Explain why a 1-D array of Boolean values is a suitable data structure to store the user’s responses. For each correct response, 5 points are added to the user’s score. Using a programming language of your choice, write efficient code to calculate the user’s final score. Your code should use a running total within a loop. Explain why the quiz program would be compiled. Scott is developing an online quiz with ten true or false questions. At the end of the quiz, the user’s final score will be calculated.
One mark each for: • stores multiple values • each value is either True or False. Description of a Boolean values and arrays will be answered in a variety of ways. One mark each for: • Loop 10 times • IF • Condition indicating answer is correct • Increment score by 5 Allow for language variations of fixed loop with 10 iterations. For example: • 0 to 9 • 1 to 10 • range(10) A condition loop may be awarded a mark if the answer indicates the loop will repeat for each question Allow for language variations of increment. For example: • Total =+ 5 Any one from: • translator does not need to be present when executing • program would not need to be translated again • program runs/executes faster as it does not require further translation • program needs to be converted to binary to run • to identify a list of errors in the code • compiled version of the program requires less memory (RAM). No mark for “runs faster” on its own with no explanation.