Revising Algorithms - Mark Scheme
Revising Algorithms - Mark Scheme
Is equal to
8. Why are their speech marks around the word “yes” in line 5 [1]
Because it is a text string
2.
4. If we added another bird to the data structure in line 1 what would we need to change in line 8?
Why? [3]
Lists index at 0 so the 7 is the number of elements in the list and will be the number of times the
loop goes through the list. If you add an element to the list you need to increase the number of
cycles through the loop by 1 as well
3.
This program displays the times table of whatever is in num it shows the first 12 cases of the table
If I change the value in line 3 from 12 to 10 what difference will it make [1]
now it will only display the first 10 cases of the table
To make it an integer
Extension Work:
1.
a) Open one of the programs that you have written and copy and paste it here
b) Identify all the variables/Constants in the program (A constant is a a container for data
which does not change through the life of the program eg PI, VAT)
c) Explain how you differentiate between the different data types of the variables in the
program (Strings are green and surrounded by Speechmarks; Integers are whole numbers;
Floats are decimal numbers and Booleans appear as yellow in the code and either say True
of False.)
d) Indicate where ITERATION is taking place in your program (Usually indicated by WHILE or
FOR loops)
e) Indicate where SELECTION is taking place in your program (Usually indicated by IF ELIF ELSE)
2. Explain what is meant by a SYNTAX error. Using the code you have been reviewing amend it to
add a syntax error – and add the code here. Highlight the syntax error
A syntax error is an error in the rules of the program such as missing out a comma or a semi-colon or
a bracket.
3. Explain what is meant by a LOGICAL error. Give an example of the type of mistake which is a
logical error and what effect logical errors can have on a program
A logical error is an error in the logic of the program eg trying to divide by 0. This is not possible and
will give an error message. Some logic errors to do not stop the program from running but they give
a wrong answer