paper 2 Flashcards

1
Q

what is meant by decomposition

A

breaking a complex problem down into smaller problems and solving them individually

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is meant by abstraction

A

picking out the important bits of the information and leaving out the specific details that don’t matter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

why is using algorithmic thinking useful when solving a problem

A

that algorithm could then be reused and adapted to solve similar problems in the future

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is meant by algorithmic thinking

A

a logical way of getting from a problem to the solution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

define integer

A

whole number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

define real

A

decimal numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

define boolean

A

can only take one of two values usually TRUE or FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

define character

A

a single, letter, number, or symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

define string

A

a collection of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what does casting mean

A

changes the data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

explain what int() does

A

converts the string 1 to the number 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

explain what float() does

A

converts the integer 1 to the float 1.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

explain what str() does

A

converts boolean true to the string true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

explain what ASC() does

A

converts character b to ASCII number 98

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

explain what CHR() does

A

converts number 98 to ASCII letter b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how does == differ from =

A

= assignment opperator, == comparison opperator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what does != do

A

is not equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what does ** do

A

multiplies a number to the power of a number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

what is meant by a constant

A

assigned to a data value and cannot be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what is meant by a variable

A

assigned to a data value and can be changed

21
Q

define string concatenation and give an example of it being used

A

joining together strings end-to-end

x = “Python is “
y = “awesome”
z = x + y
print(z)

22
Q

explain what x.upper does

A

changes all characters in string x to upper case

23
Q

explain what x.lower does

A

changes all characters in string x to lower case

24
Q

explain what x.length does

A

returns the number of characters in string x

25
Q

explain what x.subString(a,b) does

A
extracts a string at position a and length b from string x
x = hello
 x.substring(3,2) =lo
0 1 2 3 4
h e l   l  o
26
Q

why is binary used in computers

A

computers use electronic circuits that function as switches and can be turned on and off
0 represents on
all data must be converted into binary to be processed

27
Q

what are the units in order size

A
bit 
nibble
byte
kilobyte
megabyte
gigabyte
terabyte
petabyte
28
Q

convert 240 into binary

A

128 - 64 - 32 - 16 - 8 - 4 - 2 - 1 [240- 128=112]

1 1 1 1 0 0 0 0 [112-64 = 48] [48-32=16] [16-16=0] [0-8=-8]​ 240 =11110000

29
Q

convert 148 into hexadecimal

A

148%16 =9 remainder 4

148 = 94

30
Q

convert 00111000 into denary

A

128-64-32-16-8-4-2-1
0- 0- 1- 1- 1-0-0-0
00111000 = 32+16+8 = 56

31
Q

convert 101011 into hexadecimal

A
split byte into nibbles 
4-2-1        4-2-1
1-0-1         0-1-1
4+1 = 5     2+1=3
101011=53
32
Q

convert 4A into denary

A

4*16 =64 10=a
64+10=74
4A = 74

33
Q

convert D9 into binary

A
D=13 = 1101
9= 1001
D9 = 11011001
34
Q

add the binary numbers 01011101 and 00110010

A

0 1 0 1 1 1 0 1
0 0 1 1 0 0 1 0
——————-
1 0 0 0 1 1 1 1

35
Q

what is an overflow error

A

when a number has too many bits

36
Q

what effect do left and right shifts have on binary numbers

A

for every place shifted left the number doubles

for every place shifted right the number halves

37
Q

give three reasons why programmers prefer hexadecimal over binary and denary

A

simpler to remember large numbers in hex
less chance of input errors
easier to convert between binary and hex

38
Q

what is the definition of a character set

A

a collection of characters that the computer recognises from their binary representation

39
Q

give the four types of characters that are included in the character set

A

letters
symbols
numbers
special characters which do commands (space)

40
Q

what are the three main character sets

A

ASCII - most commonly used character set and can represent 128 different characters
Extended ASCII - 256 characters
Unicode - every possible character

41
Q

how many bits does it take to represent each character in the main character set

A

ASCII - 7 bits A-65 a-97
Extended ASCII - 8 bits
Unicode - 16-bit and 32-bit

42
Q

What is iteration?

A

‘iteration’ is repeating the same code more than once (looping).

Iteration is one of three main constructs in programming

43
Q

What type of programming construct is demonstrated by the following pseudocode:

for i=0 to 7
print(i)
next i

A

This is an example of iteration

44
Q

How many times would the following pseudocode print?

for i=0 to 7
print(i)
next i

A

8 times - 0 1 2 3 4 5 6 7

45
Q

What would the following pseudocode do?

for i=0 to 7
print(i)
next i

A

it would print the numbers 0 1 2 3 4 5 6 7

46
Q

Which programming construct is shown by the following pseudocode?

if entry == ”a” then
print(“You selected A”)
elseif entry == ”b” then
print(“You selected B”)
else
print(“Unrecognised selection”)
endif
A

This is an example of selection

47
Q

What does the following pseudocode do?

while answer != ”computer”
answer=input(“What is the password?”)
endwhile

A

repeatedly asks the user to input the password until they enter “computer”

48
Q

What is sequence?

A

‘sequence’ is about the ordering of the steps in an algorithm.

sequence is one of 3 main constructs in programming.

49
Q

Which programming construct is shown by the following pseudocode?

print(“Welcome to my program”)
username = input(“What is your username?”)
password = input(“What is your password?”)

A

sequence