Computer Science Paper 1 Specification Key Cards
0.0 / 5
- Created by: mugmaniac
- Created on: 15-05-22 12:59
What is a subroutine?
A subroutine is a set of instructions stored under one name that can be called at any time in the program to carry out those instructions
1 of 52
Benefits of using subroutines
- Cut down on repeated code
- Makes the code more readable
- Can help to make the code reusable.
- Makes the code more readable
- Can help to make the code reusable.
2 of 52
Drawbacks of using Global Variables
- They can unintentionally affect other parts of the program or be affected.
3 of 52
What is the adv and dis of merge sort?
Adv:
More efficient and quicker than the bubble sort for bubble sorts.
Consistent running time regardless of how ordered the list.
Dis:
- If its already sorted , it goes though the whole process.
- It uses more memory than the bauble sort because of addit
More efficient and quicker than the bubble sort for bubble sorts.
Consistent running time regardless of how ordered the list.
Dis:
- If its already sorted , it goes though the whole process.
- It uses more memory than the bauble sort because of addit
4 of 52
What is the Adv and Dis of Bubble Sort?
Adv:
- Its a simple algorithm that can be easily implemented.
- It's and efficient way to check if it is already in order
- Not as much memory used
Dis:
- Inefficient way to sort a list.
- Pretty slow against larger lists.
- Its a simple algorithm that can be easily implemented.
- It's and efficient way to check if it is already in order
- Not as much memory used
Dis:
- Inefficient way to sort a list.
- Pretty slow against larger lists.
5 of 52
What is a definite iteration and a Indefinite iteration?
An indefinite iteration does not have a set end loop and does the loop until it is false while, an definite loop does it a certain number of times always.
6 of 52
for x in range(0,5):
print ("hi")
how many times will hi be printed out?
print ("hi")
how many times will hi be printed out?
5 times
(you can find out of how many times it repeats itself by doing end - start.
(you can find out of how many times it repeats itself by doing end - start.
7 of 52
What is MOD and DIV in python?
MOD is % and DIV is //
8 of 52
What are the 6 comparison operators?
== (compare)
!= (not equal)
> (greater than)
< (less than)
>=(greater than or equal to)
<= (less than or equal to)
!= (not equal)
> (greater than)
< (less than)
>=(greater than or equal to)
<= (less than or equal to)
9 of 52
What is structured programming?
Structured programming involves breaking down into smaller, more manageable tasks called modules.
10 of 52
Advantages of structured programming.
- Testing is easier
- Modules can be reused in the future
-
- Modules can be reused in the future
-
11 of 52
What is Robust Coding?
Robust coding is if it takes an input it wasn't expecting and will less likely to fail.
12 of 52
What are Syntax Errors and Logic Errors?
Syntax errors are errors which break the grammatical rules of the program.
Logic error are errors which produce unexpected outputs.
Logic error are errors which produce unexpected outputs.
13 of 52
What are the 5 types of validation?
Type Check (Data type)
Range Check
Presence Check (Blank or not)
Format Check (the input is in the correct format)
Length Check (Min/Max of characters)
Range Check
Presence Check (Blank or not)
Format Check (the input is in the correct format)
Length Check (Min/Max of characters)
14 of 52
What is High level Language and Low level Language?
Low level language is an assembly language and is a lot more harder to understand and to write. such as Binary, but is fast to execute and memory efficient.
High level languages is written in languages such as Python, C++ etc. It is a lot more easier to
High level languages is written in languages such as Python, C++ etc. It is a lot more easier to
15 of 52
What is an Assembler and disadvantages and Advantages of using it?
Translates code in low level assembly language into machine code.
Adv:
- No need for translation software at run time
- Speed of execution is quick.
Dis:
- Hard to write code in assembly.
- Code needs to be reassembled when the code is changed.
Adv:
- No need for translation software at run time
- Speed of execution is quick.
Dis:
- Hard to write code in assembly.
- Code needs to be reassembled when the code is changed.
16 of 52
What is an Compiler?
Translates source code from high-level languages into object code and then into code to be ready processed by the CPU.
The whole program is translated into machine code before it is run.
The whole program is translated into machine code before it is run.
17 of 52
Disadvantages and Advantages of using a Compiler?
Adv:
- No need for translation software at run time.
- Code is usually optimised
Dis:
- Source code is easier to write in high level languages but won't run with syntax errors
- Code needs to be recompiled when code is changed
- No need for translation software at run time.
- Code is usually optimised
Dis:
- Source code is easier to write in high level languages but won't run with syntax errors
- Code needs to be recompiled when code is changed
18 of 52
What is an Interpreter?
Translates source code from high level languages into machine code ready to be processed by the CPU.
The program is translated line by line as the program is running.
The program is translated line by line as the program is running.
19 of 52
Disadvantages and Advantages of using a Interpreter?
Adv:
- Easy to write source code, stopping when it finds a syntax error
- Code does not need to be recompiled when code is changed and it is easy to try out commands when the program has paused after finding an error.
Div:
- Translation software is needed
- Easy to write source code, stopping when it finds a syntax error
- Code does not need to be recompiled when code is changed and it is easy to try out commands when the program has paused after finding an error.
Div:
- Translation software is needed
20 of 52
How is source code translated.
Assembly language is translated through an assembler into machine code.
A High level language is translated through an interpreter to machine or a compiler then a object code into machine code.
A High level language is translated through an interpreter to machine or a compiler then a object code into machine code.
21 of 52
What is a Pixel?
- A single point in a graphical image
22 of 52
How many characters can ASCII use as well as extended?
ASCII uses 128 characters and uses 7 bits in a byte for a character, while extended uses 8 bits and represents 256 characters
23 of 52
What does Unicode and Ascii have in common.
Uses same codes as ASCII until 127
24 of 52
Where can binary shifts be used?
Can be used to perform multiplication or division such as a binary shift of one left, is multiplying by 2, 2 left shift is four and so on.
25 of 52
What is pixel short for?
Picture element
26 of 52
What is Normal data?
Sensible, valid data that the program should be able to accept and be able to process.
27 of 52
What is Boundary Data
Valid data that falls at the boundary of any possible ranges
28 of 52
What is erroneous data?
Invalid data that the program cannot process and not accept.
29 of 52
What is System Software
System software is any software that assists with the running or management of the computer system.
30 of 52
What is Application Software?
Application software is any software added to the system that enables the user to perform a task.
31 of 52
What is a substring?
a substring is a sequence of letters in a string, usually picked by doing.
string[3:5]
string[3:5]
32 of 52
How is an algorithm efficient?
- How much memory it uses.
- How fast it executes code
- How fast it executes code
33 of 52
What code is used in subroutines?
def subroutinename(parameters)
34 of 52
What are parameters in subroutines?
Values that is entered into the subroutine and accepts.
35 of 52
What code is used for random number generation?
Import Random
num = random.randint(0,5)
num = random.randint(0,5)
36 of 52
What range of numbers in ascii that defines lower case letters?
97 - 122 character
37 of 52
What range of numbers in ascii that defines capital letters?
65 - 90
38 of 52
What is a Record?
A record is a name that multiple different data types are underneath.
39 of 52
Why would you use a record over an array?
a record can store multiple data types that relate to each other while an array cannot.
40 of 52
What is an array?
A List or a data structure.
41 of 52
What are the three boolean operators?
NOT, AND, OR
42 of 52
What is a nested iteration and nested selection?
Nested iteration is a loop inside of a loop while a nested selection is a if statement inside a if statement.
43 of 52
What data type would you use for distance or price?
A float/real
44 of 52
What Data type would you use for age or a number of chairs?
A integer
45 of 52
Arr = [[1,2],[3,4]]
print(arr[1][0])
What does it output?
print(arr[1][0])
What does it output?
3
46 of 52
What is a bubble sort?
Goes through a list compares the 2 adjacent values and swaps them if one behind it is bigger, in ascending sense.
47 of 52
What is merge sort?
Breaks a list into separate pieces and put them back together comparing each piece every time they are put back together.
48 of 52
What is a binary search algorithm?
a binary search algorithm halves the list in half every time in order to find the value in a ordered list.
49 of 52
What is a Linear search Algorithm?
a linear search algorithm goes through the list from start to end, comparing each value to the value it is looking for, and ends when it finds it or is at the end.
50 of 52
What is the Adv and Div of a linear search algorithm?
Adv:
- List doesn't need to be sorted.
- Small lists can be quickly searched.
Div:
- Not efficient when going against large lists
- List doesn't need to be sorted.
- Small lists can be quickly searched.
Div:
- Not efficient when going against large lists
51 of 52
What is the Adv and Div of a binary search algorithm?
Adv:
- quick for being used for large lists.
Div:
- Needs the list to be ordered first.
- quick for being used for large lists.
Div:
- Needs the list to be ordered first.
52 of 52
Other cards in this set
Card 2
Front
Benefits of using subroutines
Back
- Cut down on repeated code
- Makes the code more readable
- Can help to make the code reusable.
- Makes the code more readable
- Can help to make the code reusable.
Card 3
Front
Drawbacks of using Global Variables
Back
Card 4
Front
What is the adv and dis of merge sort?
Back
Card 5
Front
What is the Adv and Dis of Bubble Sort?
Back
Similar Computing resources:
5.0 / 5 based on 4 ratings
3.5 / 5 based on 4 ratings
4.5 / 5 based on 2 ratings
0.0 / 5
0.0 / 5
0.0 / 5
0.0 / 5
1.0 / 5 based on 1 rating
Comments
No comments have yet been made