computer science - paper 1

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

1/917

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

918 Terms

1
New cards

What is abstraction in computational thinking?

Abstraction is removing unnecessary details and focusing only on the relevant information when solving a problem.

2
New cards

Why is abstraction important in computer science?

It simplifies complex systems so we can focus on what matters.

3
New cards

When you save a file, why is it an example of abstraction?

You don’t need to know where or how it’s stored in binary—just how to save or open it.

4
New cards

What does a satellite navigation map hide from the user?

It hides details like trees and buildings, showing only roads and directions.

5
New cards

Why are icons like a house or key examples of abstraction?

They are simplified images that represent a function, not exact real-world objects.

6
New cards

How is a road map stored in a navigation program?

As data about road connections and distances, not as a visual map.

7
New cards

What does a flowchart represent in abstraction?

A simplified version of a program’s logic without real code.

8
New cards

What do variables like A, B, and C hide from the programmer?

The memory locations, binary values, and how the CPU does calculations.

9
New cards

What is the main goal of abstraction in problem-solving?

To hide unnecessary complexity and highlight important parts.

10
New cards

What is decomposition in computational thinking?

Breaking a complex problem into smaller, more manageable parts.

11
New cards

Why is decomposition important for programmers?

It makes solving large problems easier by solving smaller parts one at a time.

12
New cards

What everyday activities involve decomposition?

Getting ready in the morning, brushing teeth, going to school, and doing homework.

13
New cards

How can crossing the road be seen as decomposition?

You break it into steps: stop, look, decide if it's safe, press button, wait, then cross.

14
New cards

When should graphics and sound be added to a game?

After the main gameplay works — add flair like effects and sound later.

15
New cards

How does decomposition help with teamwork?

Different people can work on different parts at the same time.

16
New cards

How does decomposition save time and cost?

By letting teams work in parallel and reuse code in future projects.

17
New cards

What is a subprogram?

A subprogram is a block of code given a unique, identifiable name in a program.

18
New cards

Why do we use subprograms?

To break a large problem into smaller, more manageable parts.

19
New cards

What are some benefits of using subprograms?

They're easier to code, debug, test, and reuse.

20
New cards

In Python, what keyword is used to define a subprogram?

def

21
New cards

What happens when the main program calls a subprogram?

The program jumps to that subprogram, runs it, and returns to the main program afterward.

22
New cards

How do you call a subprogram in Python?

y writing its name followed by brackets — for example: initialise()

23
New cards

What is used to exit a subprogram early before the last line?

The return statement.

24
New cards

What are the two types of subprogram?

Procedures and Functions

25
New cards

What are the three main stages of a computer program?

Input, Process, and Output.

26
New cards

What is an input?

Data supplied to a program so it can perform its task.

27
New cards

What is a process?

The action the program takes on the input, like calculations or data changes.

28
New cards

What is an output?

The result produced by the program and given to the user.

29
New cards

What should you think about when planning inputs?

  • What data is needed

  • Variable names

  • Data types (e.g. int, float, string)

30
New cards

What should you think about when planning processes?

  • What calculations or changes need to happen

  • Whether data types need to change

31
New cards

What should you think about when planning outputs?

  • What the user needs to see

  • Variable names and data types for storing results

32
New cards

What is an algorithm?

A step-by-step set of instructions to solve a problem.

33
New cards

What is pseudocode?

A way to write algorithms that looks like code but uses plain English.

34
New cards

What is a flowchart?

A diagram that shows the steps of an algorithm using shapes and arrows.

35
New cards

What shape means "Start" or "End" in a flowchart?

An oval.

36
New cards

What shape means a decision (yes or no)?

A diamond.

37
New cards

What shape shows a process or calculation?

A rectangle.

38
New cards

What shape is used for input or output?

A parallelogram.

39
New cards

What does a line or arrow show in a flowchart?

The direction or flow of the algorithm.

40
New cards

What does "refining an algorithm" mean?

Changing or improving it to solve a problem better.

41
New cards

What methods do you use in Paper 1 to show algorithms?

Pseudocode and flowcharts.

42
New cards

What are the four primitive data types you need to know?

Integer, real, Boolean, and character.

43
New cards

What is a structured data type?

A sequence of items that are themselves data types.

44
New cards

Give an example of a structured data type.

String, array, or record.

45
New cards

What is a comment in Python?

A line starting with #, which is ignored by the program.

46
New cards

What is an identifier in Python?

A name used for variables, procedures, or functions, starting with a letter and using letters, numbers, or underscores.

47
New cards

What does assignment mean in Python?

Giving a variable a value using the equals sign.

48
New cards

How do you change data types in Python?

Use conversion functions like int(), str(), float(), or bool().

49
New cards

What is sequence in programming?

Instructions are executed one after the other, from top to bottom.

50
New cards

What is selection in programming?

Making a choice using if, else, or elif statements.

51
New cards

What is iteration?

Repeating code using for or while loops.

52
New cards

What is a subprogram?

A reusable block of code, like a function or procedure.

53
New cards

What does the print() function do?

Outputs data to the screen.

54
New cards

What does the input() function do?

Takes user input from the keyboard.

55
New cards

Why is indentation important in Python?

It shows which lines belong to the same block of code.

56
New cards

What is a data structure?

A specialised format for organising and storing data.

57
New cards

What is a string made up of?

A sequence of character data types.

58
New cards

What is an array?

A static data structure that stores multiple items of the same data type in contiguous memory.

59
New cards

What does ‘contiguous’ mean in the context of arrays?

The data items are stored next to each other in memory.

60
New cards

What is meant by arrays being zero-indexed?

The first item in the array is at index 0, not 1.

61
New cards

How is a list different from an array in Python?

Lists are not necessarily stored contiguously and can hold mixed data types.

62
New cards

Are arrays static or dynamic?

Static — their size cannot be changed after creation.

63
New cards

What is a one-dimensional array?

An array with one index per item, like a list of names.

64
New cards

What is a two-dimensional array?

An array with two indexes (rows and columns), like a table.

65
New cards

Can arrays contain more than one data type?

No, they must contain only one data type (homogeneous).

66
New cards

What is a record data structure?

A collection of related fields that can each have different data types.

67
New cards

Do Python support records?

No, but other languages like Visual Basic do.

68
New cards

What symbol is used for addition in Python?

+

69
New cards

What symbol is used for subtraction in Python?

-

70
New cards

What symbol is used for multiplication in Python?

*

71
New cards

What symbol is used for division in Python?

/

72
New cards

What symbol is used for exponentiation (power) in Python?

**

73
New cards

What does the modulus operator (%) return?

The remainder after division

74
New cards

What is integer division and its symbol in Python?

// returns t/he whole number part of the division

75
New cards

What symbol checks if two values are equal?

==

76
New cards

What symbol checks if two values are not equal?

!=

77
New cards

What symbol checks if one value is less than another?

<

78
New cards

What symbol checks if one value is less than or equal to another?

<=

79
New cards

What symbol checks if one value is greater than another?

>

80
New cards

What symbol checks if one value is greater than or equal to another?

>=

81
New cards

What are the three common Boolean operators?

NOT, AND, OR

82
New cards

What does the NOT operator do?

It reverses a Boolean value.

83
New cards

What does the AND operator do?

It returns True only if both conditions are true.

84
New cards

What does the OR operator do?

It returns True if at least one condition is true.

85
New cards

How can you use Boolean operators in loops?

In if, while, or do until statements to control program flow based on conditions.

86
New cards

What is a Boolean expression?

An expression that evaluates to True or False.

87
New cards

What is an example of combining Boolean operators?

if this and that or not other

88
New cards

What are the three types of programming errors?

Syntax errors, logic errors, and runtime errors.

89
New cards

What is a syntax error?

An error that breaks the grammatical rules of the programming language.

90
New cards

What is a logic error?

The program runs, but gives the wrong or unexpected result.

91
New cards

What is a runtime error?

An error that crashes the program while it's running.

92
New cards

Why are logic errors harder to find than syntax errors?

Because the program runs, but the output is wrong.

93
New cards

What is the purpose of the bubble sort algorithm?

To sort an unordered list by repeatedly comparing and swapping adjacent items if they are in the wrong order.

94
New cards

How does the bubble sort algorithm work?

  1. Compare each item with the next one.

  2. Swap if out of order.

  3. Repeat passes until no more swaps are needed.

  4. Each pass "bubbles" the largest/smallest item to its correct position.

95
New cards

What happens during each pass of bubble sort?

The largest remaining unsorted item moves to its final position at the end of the list.

96
New cards

What is the main advantage of bubble sort?

It’s simple and easy to implement, especially for small data sets.

97
New cards

What is the main disadvantage of bubble sort?

It's very inefficient for large data sets because it does many unnecessary comparisons and swaps.

98
New cards

When does bubble sort stop running?

When a full pass happens with no swaps made — this means the list is sorted.

99
New cards

What kind of data is bubble sort suitable for?

Very small data sets, where performance isn’t a big concern.

100
New cards

In bubble sort pseudocode, what does the swapped flag do?

It keeps track of whether any swaps happened in a pass.