= 10 then 05 print("success") 06 else 07 print("warning") 08 endif The algorithm does not work correctly. Identify the line number of the two logic errors in the algorithm and refine the code to correct each logic error. Line number ..................................................................................................................................... Correction ......................................................................................................................................... .......................................................................................................................................................... Line number ...................................................................................................................................... Correction ......................................................................................................................................... .......................................................................................................................................................... [4] 4 © OCR 2024 (c) (i) Show how a binary search will be used to find the number 10 in the following data set:">

INSTRUCTIONS
• Use black ink.
• Write your answer to each question in the space provided. If you need extra space use
the lined pages at the end of this booklet. The question numbers must be clearly shown.
• Answer all the questions.
INFORMATION
• The total mark for this paper is 80.
• The marks for each question are shown in brackets [ ].
• This document has 20 pages.
ADVICE
• Read each question carefully before you start your answer.
• We advise you to spend approximately 50 minutes on Section A and approximately
40 minutes on Section B.
© OCR 2024 [601/8355/X]
DC (ST) 342920/6
2
© OCR 2024
SECTION A
We advise you to spend approximately 50 minutes on Section A.
1 Tick (✓) one box in each row to identify the programming construct where each keyword is used.
Keyword
Programming construct
Selection Iteration
if
for
while
[3]
2 An algorithm decides if a number is odd or even.
An odd number divided by 2 will give the remainder 1.
The flowchart statements have been written for the algorithm, but the flowchart is incomplete.
Complete the flowchart.
Start
INPUT num
if num MOD 2 == 0 OUTPUT "Odd"
OUTPUT "Even"
End
[4]
3
© OCR 2024 Turn over
3
(a) State what is meant by the term syntax error. Give one example of a syntax error in a program.
Definition ..........................................................................................................................................
 ..........................................................................................................................................................
Example ...........................................................................................................................................
 ..........................................................................................................................................................
 [2]
(b) A student writes an algorithm to input two numbers and add them together to create a total.
If the total is between 10 and 20 inclusive, "success" is output.
If the total is not between 10 and 20 inclusive, "warning" is output.
 01 num1 = input("Enter a number")
 02 num2 = input("Enter a number")
 03 total = num1 + num1
 04 if total >= 10 then
 05 print("success")
 06 else
 07 print("warning")
 08 endif
The algorithm does not work correctly.
Identify the line number of the two logic errors in the algorithm and refine the code to correct
each logic error.
Line number .....................................................................................................................................
Correction .........................................................................................................................................
 ..........................................................................................................................................................
Line number ......................................................................................................................................
Correction .........................................................................................................................................
 ..........................................................................................................................................................
[4]
4
© OCR 2024
(c)
(i) Show how a binary search will be used to find the number 10 in the following data set:

No comments found.
Login to post a comment

jordancarter 6 months ago

This study guide is clear, well-organized, and covers all the essential topics. The explanations are concise, making complex concepts easier to understand. It could benefit from more practice questions, but overall, it's a great resource for efficient studying. Highly recommend!
Login to review this item
Q. What will I receive when I purchase this document?
A. You will receive a PDF that is available for instant download upon purchase. The document will be accessible to you at any time, from anywhere, and will remain available indefinitely through your profile.
Q. Satisfaction guarantee: how does it work?
A. Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Q. Who am I buying these notes from?
A. you are buying this document from us learnexams
Q. Will I be stuck with a subscription?
A. No, you only buy these notes for $ indicated . You are not obligated to anything after your purchase.
Q. Can learnexams be trusted?
A. check our reviews at trustpilot
Price $15.50
Add To Cart

Buy Now
Category AQA PAPERS AND MARK SCHEME
Comments 0
Rating
Sales 0

Buy Our Plan

We have

The latest updated Study Material Bundle with 100% Satisfaction guarantee

Visit Now
{{ userMessage }}
Processing