AQA alevel computer science paper 1
questions and answers
What is an algorithm - An algorithm is a set of rules or sequence of steps that
specify how to solve a problem
What is an integer give an example - a whole number that can be negative or
positive e.g -1 or 34
What is a real/float - a decimal number that is negative or positiive
What is boolean - true or false
What is a character - A letter or a number
What is a string - anything enclosed by quotation marks also known as a series of
characters
What does the round function do - rounds the number to the given value e.g -
6.56664 rounded to 2 decimal places is 6.6
,AQA alevel computer science paper 1
questions and answers
What does the trunc function do - the trunc function rounds a real number to the
nearest whole number it basically cuts the decimal part off. 4.55 truncated is 4
What does exponentiation do - Raises to the power e.g 2^3 = 8
what does integer division do - gives you the remainder. div finds the whole
number whilst mod finds the remainder
What does the len function do - returns the length of an object or number of
characters in a string
What does the string.substring function do - it returns the portion of the string
inclusive to the index e.g word = ' hello' word.substring(index1,index2) = he
what does string.find do - if the variable is a string it returns the index of the first
string and if not it returns a -1
what does ord do - returns the integer value of a character a-97
,AQA alevel computer science paper 1
questions and answers
what does chr do - returns the integer represented by a character 97-a
What does concatenation do - it joins two strings together
how do you convert a string to an integer - int('string')
how do you convert a integer to a string - str(123)
how do you convert a string to a float - float('123.34')
how do you convert a float to a string - str(123.343)
What is a variable - an identifier given to a memory location whos contents may
be changed during the course of a program they should always be given
meaningful names
What is a constant - when the value of the variable never changes and stays fixed/
, AQA alevel computer science paper 1
questions and answers
Whats the advantage of using a constant - The advantage of using a constant is
that in a long complex program you reduce the risk of accidently changing a
variable or reuisng the same name you used for the constant. an example of this
could be wanting to keep pi = 3.14
What are the three basic programming constructs - sequence, selection, iteration
What is a sequence - two or more statements following one after the other
What is an assignment statement - A statement that sets a variable to a specified
value.
What is a selection statement used for - to select which statement will be
executed next depending on some conditions. This conditions are mased using
relational operators
What is a CASE statement - A way of writing complex selection without lots of
ELSE Ifs
What is AND, OR, NOT,. XOR - Boolean operators
questions and answers
What is an algorithm - An algorithm is a set of rules or sequence of steps that
specify how to solve a problem
What is an integer give an example - a whole number that can be negative or
positive e.g -1 or 34
What is a real/float - a decimal number that is negative or positiive
What is boolean - true or false
What is a character - A letter or a number
What is a string - anything enclosed by quotation marks also known as a series of
characters
What does the round function do - rounds the number to the given value e.g -
6.56664 rounded to 2 decimal places is 6.6
,AQA alevel computer science paper 1
questions and answers
What does the trunc function do - the trunc function rounds a real number to the
nearest whole number it basically cuts the decimal part off. 4.55 truncated is 4
What does exponentiation do - Raises to the power e.g 2^3 = 8
what does integer division do - gives you the remainder. div finds the whole
number whilst mod finds the remainder
What does the len function do - returns the length of an object or number of
characters in a string
What does the string.substring function do - it returns the portion of the string
inclusive to the index e.g word = ' hello' word.substring(index1,index2) = he
what does string.find do - if the variable is a string it returns the index of the first
string and if not it returns a -1
what does ord do - returns the integer value of a character a-97
,AQA alevel computer science paper 1
questions and answers
what does chr do - returns the integer represented by a character 97-a
What does concatenation do - it joins two strings together
how do you convert a string to an integer - int('string')
how do you convert a integer to a string - str(123)
how do you convert a string to a float - float('123.34')
how do you convert a float to a string - str(123.343)
What is a variable - an identifier given to a memory location whos contents may
be changed during the course of a program they should always be given
meaningful names
What is a constant - when the value of the variable never changes and stays fixed/
, AQA alevel computer science paper 1
questions and answers
Whats the advantage of using a constant - The advantage of using a constant is
that in a long complex program you reduce the risk of accidently changing a
variable or reuisng the same name you used for the constant. an example of this
could be wanting to keep pi = 3.14
What are the three basic programming constructs - sequence, selection, iteration
What is a sequence - two or more statements following one after the other
What is an assignment statement - A statement that sets a variable to a specified
value.
What is a selection statement used for - to select which statement will be
executed next depending on some conditions. This conditions are mased using
relational operators
What is a CASE statement - A way of writing complex selection without lots of
ELSE Ifs
What is AND, OR, NOT,. XOR - Boolean operators