paper 1 computer science Flashcards

1
Q

what is a subroutine

A

‘out of line’ block of code that may be executed (called) by simply writing its name in a program statement.

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

what is the function of the parameters

A

allows data to be ‘ passed’ into a subroutine

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

what is a procedure

A

a subroutine that executes a specific task but DOES NOT RETURN A VALEUE

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

subroutines can either be ——- written or ————-

A

user written or pre - existing

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

what is a function

A

a subroutine that executes a specific task and DOES RETURN A VALEUE

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

what are pre existing / pre - defined subroutines

A

subroutines that are built in or imported from external libraries of code

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

what are examples of pre - existing / pre - defined subroutines

A

input () , len (), print()

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

what are libraries in subroutines

A

collections of pre- written subprograms for specific purposes that can be included in the program

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

what is a local variable

A

variable declared within a specific section of code eg as a function or procedure, and is accessible only within that subroutine = cannot be accessed / modified outside the subroutine where it was declared

AND ONLY EXIST WHILE THE SUBROUTINE IS EXECUTING

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

what is a global variable

A

variable that is declared outside of all subroutines or functions = accessible and modifiable throughout program, or within any subroutines.

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

what is the function of structured programming

A

helps to improve the quality and clarity of code

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

what are the 3 control structures

A

selection , iteration , sequencing

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

what are the advantages of subroutines

A
  • code is more readable and easier to understand
  • the flow ( the execution route ) is clear
  • easier for programmers to work in parallel - they can code separate modules that don’t affect each other
  • modules can be reused + code can come from different sources eg libraries
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the purpose of testing

A

to find errors and determine ( then patch ) vulnerabilities

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

what is an error

A

an occurrence of unexpected result

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

what is a logic error

A

occurs when program’s execution appears to run as normal but not as the programmer intended

  • hardest errors to detect / fix because they logic errors occurs when programmer has made a mistake while not realising
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is syntax

A

rules that influence the structure of sentences in language, specifically word order and punctuation/ grammar syntax

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

what is syntax error

A

the instructions written by the programmer do not meet the rules of the language). and so there is a mistake in the structure of the programming statements

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

what is a runtime error

A

errors that occur only during the execution of a program. eg running out of memory( run out of space in RAM )

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

what are the three categories which is used in test data

A

normal , boundary , erroneous

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

what is normal data

A

values that would be expected of a user to enter

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

what is boundary data

A

A pair of values at each end of a range: The data at the upper or lower limits of expectations that should be accepted.

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

what is erroneous data

A

test data that falls outside of what is acceptable and is invalid

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

what is an algorithm

A

sequence of instructions that perform a specific task when followed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
what is decomposition
breaking a problem into a number of sub-problems, so that each sub-problem accomplishes an identifiable task, which might itself be further subdivided.
24
what is abstraction
process of removing unnecessary detail from a problem
25
what is pseudocode
- informal description which is intended for human reading while resembling code - has no standardised syntax
26
what does each part of the flowchart represents
27
how does linear search algorithm work
28
how does binary search work
29
how do one dimensional array store data
in one horizontal direction
30
how do two dimensional array store data
stores data horizontally and vertically
31
what are binary files
files that are formatted so that only a program can read them.
32
what are text files
file containing characters that are structures as lines of text - eg records
33
what must be done to files during use
- files must be opened before use and closed after use
34
why must files be closed after use
- closing files can free up resources = prevents corruption and ' flushes' the buffer
35
what is machine code
- form of low level language that requires the least abstraction and processors execute it directly - machine code is specific to a processor and corresponds to the instruction set
36
what is assembly code
- class of low level language - advantage : use simple mnemonics = easy
37
what are examples of low - level languages
- assembly - machine code
38
what are examples of high level language
- pseudocode - python
39
what must happen to assembly and high level language to be executed in the computer
they must be translated into machine code
40
what is the advantage of high level language
- they are portable = can be executed on many computers - most are like ordinary languages = easier to learn
41
what is a disadvantage of more abstract languages
- slower to execute
41
what are translators
- program that converts code from one language to equivalent code
42
why are translators used
because all code needs to be translated into machine code so that it can be executed
43
what are the 3 types of program translator
interpreter compiler assembler.
44
logic statements can be evaluated to either ---------- or ---------
true or false
45
what are truth tables
methods of representing every possible output based on inputs to a boolean expression
46
in logic gates what do the number 0 and 1 represent
0 = false 1 = true
47
what are the common logic gates
AND 0R NOT
48
What does the NOT symbol look like
49
what does the NOT operation do
- takes the input and reverses it
50
51
how can the NOT symbol be represented in written form
52
what does the representation of the OR gate look like
52
what is the function of the OR gate
- returns true if either of conditions are true - but will only return false if both conditions are false
53
how can the NOT symbol be represented in written form
54
what is the AND symbol
55
what is the function of the AND symbol
returns true if both the conditions are true - else the result is false
56
how is the symbol of the AND gate represented
57
wgat are the different types of software
application software system software
58
what is application software and give examples
used for user benefits eg word processors , internet browsers , games
59
what is system software and gives examples
software that performs the tasks needed to operate the hardware and provide services for other software eg: utility programs , game engines
60
what is the operating system
an essential software that links the hardware and other software together to manage the computer syste
61
what are examples of operating system
Apple macOS Microsoft Windows Google's Android OS
62
what is the of the operating system
- manages hardware - manages application installed eg utility software - creates a user interface - provides layer of security
63
what are the different user interfaces and what are they
- command - line interface - a shell respondning to successive text commands - graphical user interface - uses icons and other visual indicators to navigate and issue commands
63
what are advantages of command line interface
- more direct and compact
64
what is a multitasking operating system
- executes 1 process at a time but allows multiple applications to run by rapidly switching between processes
65
what is a single tasking operating system
- executes 1 process at a time, suspending it with interrupts if necessary
66
what is a process
a program being executed by the processor
67
what is the CPU
the circuitry that controls the manipulation of data
68
what does the CPU consist of
- ALU - CU - registers
69
what is the ALU
- arithmetic logic unit - the circuit that performs the operations ( addition , multiplication , division) on the data
70
what is the CU
- the control unit - coordinates the activities of the CPU
71
what are registers
- quick , small stores of data within the CPU