0% found this document useful (0 votes)
18 views

Revising Algorithms - Mark Scheme

This document contains questions about interpreting algorithms. It asks the reader to identify variables, data types, what programs do, where loops, selection and conditions are located. It also asks about the meaning of operators and syntax. The extension questions ask the reader to identify variables, data types, iteration and selection in a program they have written, explain syntax and logical errors, and provide an example of a logical error.

Uploaded by

Avaan Sinha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Revising Algorithms - Mark Scheme

This document contains questions about interpreting algorithms. It asks the reader to identify variables, data types, what programs do, where loops, selection and conditions are located. It also asks about the meaning of operators and syntax. The extension questions ask the reader to identify variables, data types, iteration and selection in a program they have written, explain syntax and logical errors, and provide an example of a logical error.

Uploaded by

Avaan Sinha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Intepreting Algorithms

1. What is a variable [1]


A container which holds data which changes through the life of a program

2. What data type is stored in user? [1]


string

3. What does this algorithm do? [3]


Asks you to enter your password and Userid, if they are correct it logs you in if not asks you
to re-enter your details. Does this in a loop

4. What line does the loop start? [1]


7
5. Where in this program does selection start? [1]
12
6. Where in the program does selection finish? [1]
16
7. What does == mean in this program in line 12 [1]

Is equal to

8. Why are their speech marks around the word “yes” in line 5 [1]
Because it is a text string
2.

1. What is the name of the data structure in line 1?


List

2. Identify 3 variables in this program [3]


bird, numspecies, birdfound, birdCount, birdObserved

3. How many types of birds are listed in this program? [1]


8

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.

What does this program do explain how it is working [3]

This program displays the times table of whatever is in num it shows the first 12 cases of the table

Identify 2 variables in this program [2]


Num, n

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

Why do I need the int in line 1 [1]

To make it an integer

There is a syntax error in this program what is it?

There isnt one I corrected it by accident!

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

You might also like