GCSE Computer Science Complete

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/362

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

363 Terms

1
New cards

Describe the process for a linear search

Go through each value in the list until the value matches the given input

2
New cards

Describe the process of binary search

If the input is greater than the middle element, everything below the middle element is removed, and vice versa. This repeats until the middle element matches the input.

3
New cards

Describe the process of bubble sort

An element is swapped with the next if it is larger. This repeats throughout the list - a pass. Passes repeat until the list is sorted.

4
New cards

State the time complexity

5
New cards

State the number of passes needed for a list of length n

n - 1

6
New cards

State the number of checks per pass for a list of length n

n - 1

7
New cards

Describe the process of merge sort

The list is being divided into shorter lists, being split at the middle item. Each sublist is half the length of the list it was created from. The subdivision process terminates when each sublist is of length 1. The lists are being merged together. When two lists are merged, the items in them are put into the new list in order. Eventually one list is produced - which is the sorted list.

8
New cards

Compare binary and linear search

Binary is more time-efficient for larger datasets but it is harder to program, and the list must be sorted. Linear search can be used for multi-dimensional arrays, but binary search can only be used for one-dimensional arrays. Binary search can only search for numbers but linear search can search for anything.

9
New cards

Compare merge and bubble sort

Merge sort is more time-efficient but is harder to program, but bubble sort is better in a best-case scenario. Bubble sort uses less memory

10
New cards

Define algorithm

An algorithm is a sequence of steps that can be followed to complete a task.

11
New cards

Distinguish between algorithm and program

A program is an implementation of an algorithm.

12
New cards

Define decomposition

Decomposition means breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task.

13
New cards

Define abstraction

Abstraction is the process of removing unnecessary detail from a problem.

14
New cards

What is pseudocode?

A fake language, not a programming language with syntax, that should have some consistency and relation to a language.

15
New cards

Convert this python syntax into pseudocode: name = input("Enter name"). print ("Hello", name). if name == "James": elif name == "Sid": else:.

OUTPUT "Enter name"

name <- USERINPUT

OUTPUT "Hello ", name

IF name = "James" THEN

ELSE IF name = "Sid" THEN

ENDIF

16
New cards

State the pseudocode syntax for while, for, and repeat until loops.

WHILE running = True

ENDWHILE

FOR i <- 0 to 10 STEP 2

ENDFOR

FOR char IN string

ENDFOR

REPEAT

UNTIL running = False

17
New cards

State the pseudocode syntax for a subroutine

SUBROUTINE function (num1)

ENDSUBROUTINE

OUTPUT function (1)

18
New cards

State the pseudocode syntax for creating an array

array <- ["A", "B", "C"]

OUTPUT array[2]

OUTPUT LEN(array)

19
New cards

State the pseudocode syntax for creating a record

RECORD Dog

name : string

age : integer

ENDRECORD

myDog <- Dog ("John", 3)

OUTPUT myDog.name

mydog.age <- 4

20
New cards

State the pseudocode syntax for locating the position of a character in a string

string <- "example"

OUTPUT POSITION (string, "e")

OUTPUT SUBSTRING (0, 5, string)

21
New cards

State the pseudocode syntax for conversion between characters and their ASCII values

CODE_TO_CHAR

CHAR_TO_CODE

22
New cards

What does each flowchart symbol represent?

Rounded box - start or stop. Diamond - selection. Rectangle - process. Parallelogram - input. Arrow - progression of code.

<p>Rounded box - start or stop. Diamond - selection. Rectangle - process. Parallelogram - input. Arrow - progression of code.</p>
23
New cards

What is a variable?

A location of memory that stores data.

24
New cards

How should you design variable names?

Meaningful and specific to the topic. Shouldn't have keywords like print or if. Constants should be uppercase and always remain the same.

25
New cards

Distinguish between real division and integer division

Real division returns a float, but integer division returns a (rounded down) whole number. Real division in python is /. Integer division in python is //.

26
New cards

What is the modulo?

The remainder after division, which is % in python.

27
New cards

How is exponentiation written in python?

** or pow(num1, num2)

28
New cards

State the relational operators in python

< > <= >= == !=

29
New cards

State the arithmetic operators in python

+ - / % += -= = /= //

30
New cards

What can cause a value error?

When you try to cast a variable into a different datatype.

31
New cards

What is type casting?

Changing a data type to a different type?

32
New cards

What are the main data types?

Integer, string, boolean, float.

33
New cards

How can you convert characters and ASCII values in python?

ord() converts characters to the ASCII value and chr() converts ASCII values into characters.

34
New cards

How do you convert a string into a float?

Using float()

35
New cards

What is sequence?

The order in which instructions are executed.

36
New cards

What is selection?

Conditions that change the program's direction, determining whether code should be executed.

37
New cards

What is definite and indefinite iteration?

Definite iteration finishes at a defined time, and indefinite iteration finished until a condition is met.

38
New cards

What is nested selection / iteration?

When loops / conditions are used inside other loops / conditions.

39
New cards

What is assignment?

Giving a variable a value.

40
New cards

What's the difference between arrays and lists?

Arrays are a fixed length data structure of one data type. Lists are variable length data structures of varying data types.

41
New cards

What are 2D arrays?

Arrays containing arrays. Individual elements can be abstracted by array[num1][num2]

42
New cards

What are records?

Any number of data items (fields) of any data type.

43
New cards

What are the uses of subroutines?

Keeping code neat, helping abstraction, and you can test each function separately.

44
New cards

What are the differences between functions and procedures?

Functions return values unlike procedures, where it is optional. Functions can only have input parameters but procedures can have input and output parameters. Functions must have an input parameter but procedures can take zero or any input parameters. Functions can be called from a procedure but procedures cannot be called from a function.

45
New cards

How are functions written in python?

def function (num1, num2):

return (num1, num2)

print (function(3, 5))

46
New cards

What is verification?

Checking that a software achieves its goal without any bugs (e.g. that my age is 15).

47
New cards

What is validation?

Checking that a software has correct requirements (e.g. that my age is an integer).

48
New cards

What type of validation checks are there?

Range check, type check, presence check, format check, length check

49
New cards

What is a local variable?

A variable in a function that will not be passed to the main program.

50
New cards

What is the advantage of local variables?

They do not have to be deleted after the subroutine has run.

51
New cards

What is the difference between global and local variables?

Global variables are accessible anywhere in the program and local variables are only accessible in their scope, such as in subroutines.

52
New cards

What does the structure approach involve?

Modularised programming, appropriately named variables, subroutines, code comments, well-documented interfaces.

53
New cards

What are the advantages of the structured approach?

Multiple programmers can work on different functions at a time, pre-tested subroutines can be used again or in different programs, easier maintenance and debugging, other people can understand your intentions.

54
New cards

What is try except?

The code under try is run, and if there is an error the code under except will run.

55
New cards

What is normal, erroneous, and boundary data?

Normal data is the expected data. Erroneous data falls outside of what is acceptable and should be rejected by the system. Boundary data falls outside the expected range. If your expected range is 0 < x < 101, boundary data includes 0, 1, 100, and 101, but erroneous data includes 102.

56
New cards

What is the purpose of testing?

To ensure a program works as intended under good conditions and copes with errors when given bad data.

57
New cards

How can we conduct testing?

With trace tables and test plans.

58
New cards

What is a trace table?

A table that records the variables in a programs as they change, used to check that they are correct at the end of an algorithm.

59
New cards

What format is data on computers stored in?

Binary

60
New cards

What are the names for bit storage quantities?

Bit, Byte, Kilobyte, Megabyte, Gigabyte, Terabyte. b, B, KB, MB, GB, TB.

61
New cards

What are the typical files with each of these sizes?

b - single boolean. B - ASCII character. KB - text file. MB - photos and MP3 files. GB - videos and software applications. TB - backups of whole systems.

62
New cards

What is the typical file size for a compressed HD movie?

8 GB

63
New cards

What is the typical file size for a MP3 file?

4 MB

64
New cards

What is the typical file size for a photo?

10 MB

65
New cards

What is the typical file size for a word document of a few pages?

50 KB

66
New cards

Why do computers use binary?

Binary numbers represent the flow of electricity through transistors and logic circuits. Secondary storage devices may represent the binary data in other forms, such as positively or negatively charged magnetic particles or transitions between pits and lands.

67
New cards

How is binary data transmitted across networks?

As electrical pulses, light, or encoded radio waves.

68
New cards

What is a number system?

A mechanism for representing a number using a set of symbols or digits.

69
New cards

e.g. Convert 33 into binary

100001

70
New cards

e.g. Convert 1010101 into decimal

89

71
New cards

How do we add binary numbers?

Through column additions, where 0 + 0 = 0, 0 + 1 = 1, 1 + 1 = 0 (carry 0), and 1 + 1 + 1 = 1 (carry 1).

72
New cards

What is an overflow error?

An error that occurs when the result of binary addition is too large to represent the number of bits available within the system. It can lead to inaccurate results or software crashes if not handled correctly.

73
New cards

How can we deal with an overflow error?

By storing the overflow bits in another memory location or set a special flag bit to indicate that the error has occurred. The CPU, OS, or application can detect the status of this flag and respond accordingly, e.g. by breaking the sum down into two smaller sums that can be computed and combined together.

74
New cards

How does character encoding work?

Each character in a character set is given a unique number.

75
New cards

What ASCII value is A?

65

76
New cards

What ASCII value is a?

97

77
New cards

Why is ASCII an impractical character set today?

It cannot represent non-English characters.

78
New cards

What other character sets have more characters?

The extended ASCII set uses 8 bits, providing up to 256 characters. Unicode aims to represent every possible character (including emojis), using between 8 and 48 bits per character.

79
New cards

How do you enter a hexadecimal number in python?

Prefix it with 0x.

80
New cards

e.g. What is 30 in hexadecimal?

1E

81
New cards

e.g. What is 11101010 in hexadecimal?

EA

82
New cards

e.g. What is F5 in binary?

11110101

83
New cards

e.g. What is CB in decimal?

203

84
New cards

How are images represented?

By bitmap pixels (pixel = picture element) where each pixel has a single colour assigned to it, stored as a binary value.

85
New cards

What is colour depth?

The number of bits used per pixel to represent the colour.

86
New cards

How can you calculate the number of colours possible?

2ᶜᵒˡᵒᵘʳ⁻ᵈᵉᵖᵗʰ

87
New cards

How can the colours be stored?

You could use a colour palette with a binary number for every colour, or combining amounts of red, green, and blue out of 255.

88
New cards

What is the formula for image file size?

File size = image height X image width X colour-depth

89
New cards

What is analogue and digital information?

Analogue information is continuous values that can be measured with theoretically infinite position. Digital information is discrete / finite values.

90
New cards

How can you convert between the two?

ADC (analogue-to-digital converter) or DAC (digital-to-analogue converter).

91
New cards

Describe the process of recording digital audio

The air around an object is compressed when something produces sound. The resulting pressure waves travel through the air and cause the diaphragm of a microphone to oscillate at the same frequency at the original sound, producing an electrical current. An ADC in a sound card samples the amplitude (voltage) of the electrical current produced by the microphone and converts this value into binary, which is sent to a computer for storing and processing.

92
New cards

Describe the process of playing back digital audio

The data in a sound file is passed to a DAC within a digital device, which produces an analogue signal by producing voltages based on the binary values captured at each sample within the file. These voltages travel as electrical signals to speakers, where they cause magnetic drivers to oscillate, producing compressions in the air that travel to the ear.

93
New cards

What determines the volume and pitch of the sound?

Amplitude - volume. Frequency - pitch.

94
New cards

What is a sample?

A measure of the amplitude at a point in time (stored as a binary value).

95
New cards

What is the sampling rate?

The number of samples captured per second, measured in Hz.

96
New cards

What is the sampling interval?

The time between two samples.

97
New cards

What is the sample resolution?

The number of bits used to store each sample.

98
New cards

What is the bit-rate?

The number of bits needed to store one second of audio, calculated by sampling frequency X sample resolution.

99
New cards

How do you calculate the file size?

Bit-rate X duration of recording (s)

100
New cards

What is the difference between lossless and lossy compression?

Lossy compression involves the loss of data, but lossless compression preserves all original data.