WorksheetsY9 DEC 23 MMD
Total questions: 114
Worksheet time: 1hrs 4mins
Which of the following is not done by abstraction?
Identifies essential details
Disregards non-essential information
Breaks the problem down into smaller tasks
Which of the following is not done by decomposition?
Allows multiple people to work on the problem together
Disregards non-essential information
Breaks the problem down into smaller tasks
When drawing a dog, which of the following characteristics is non-essential?
Dogs have 4 paws
Dogs have fur
Dogs have brown fur
When designing a building that must be accessible for wheelchairs, which of the following characteristics is non-essential?
Number of doors
Number of walls
Number of wall paintings
One advantage of abstraction is that it means no mistakes can be made
True
False
You could use abstraction to replace specific objects with simple shapes
True
False
This is a good example of decomposition
Sit down
Do homework
True
False
Decomposition allows each task to become _______
More manageable
Easier
Quicker
Decomposition allows the entire task to be completed as _____
A Team
A Whole
Quickly as possible
Abstraction and Decomposition are separate concepts, you would usually choose to do either one or the other
True
False
It is always necessary to decompose a task
True
False
Abstraction and Decomposition are examples of...
Computational Thinking
Algorithmic Thinking
Computer Science
Logical Reasoning
What is pattern recognition?
Breaking down a complex problem into smaller problems
Looking for similarities among and within problems
Building models from patterns
Why do we need to look for patterns in problems?
Patterns make it easier for us to solve complex problems
We don't need to look for patterns
Patterns make it more difficult complex problems
If you don't look for patterns in a problem, your solution might be _____
Wrong
Inefficient
Too slow
Identifying the steps involved in solving a problem
Abstraction
Decomposition
Pattern Recognition
Algorithmic Thinking
Looking for similarities and trends within a problem
Abstraction
Decomposition
Pattern recognition
Algorithmic Thinking
What is a flowchart?
A visual representation of an algorithm.
A diagram that shows abstraction.
A series of shapes.
A school database has lots of information on students, the data manager needs to use abstraction. What data should she leave out?
Age
Guardian's phone numbers
Classes
Eye colour
Convert the following 4 digit binary number to denary:
0 1 0 0
1
2
4
3
8
Convert the following 4 digit binary number into denary:
0 0 1 1
1
2
3
4
8
Machine code (1s and 0s) is also known as
(a)
Convert the following 4 digit binary number into denary:
0 1 1 1
6
8
7
5
9
Convert the following 4 digit binary number into denary:
0 1 0 1
5
4
3
1
7
Humans normally use what system?
Binary
Octal
Denary
Hexadecimal
Base 2
Convert the following 4 digit binary number into denary:
1 0 1 1
17
9
10
11
13
Convert the following 4 digit binary number into denary:
1 0 0 1
5
7
9
11
12
Convert the following 4 digit binary number into denary:
1 1 1 0
17
19
14
16
18
Convert the following 4 digit binary number into denary:
1 1 1 1
15
16
17
19
0
What BASE is binary? (Enter a number only)
(a)
Convert the following 4 digit binary number into denary:
0 0 0 0
10000
0
Invalid
16
9999+1
What BASE does the human numbering system (Denary) use?
(Enter a number only)
(a)
Convert the following 4 digit binary number into denary:
1 0 1 0
10
Error
11
12
14
Which of the following is the ODD number?
1110
1000
1010
1101
0010
The CPU is the (a) of the computer.
Inside the CPU, you will find:
ALU, CU, registers, cache memory
ADU, PC, storage, RAM memory
ARM, PC, controller, cache memory
APM, CU, time signal, RAM memory
The ALU....
does any maths or logic problems for the CPU
stores data inside the CPU
sends out control signals for the CPU
holds specific data for the fetch-decode-execute cycle
The CU...
does any maths or logic problems for the CPU
stores data inside the CPU
sends out control signals for the CPU
holds specific data for the fetch-decode-execute cycle
The cache memory...
does any maths or logic problems for the CPU
stores frequently used instructions close to the CPU
sends out control signals for the CPU
holds specific data for the fetch-decode-execute cycle
The registers...
do any maths or logic problems for the CPU
store data inside the CPU
send out control signals for the CPU
hold specific data for the fetch-decode-execute cycle
The MAR stores the (a) of data which is either being sent to or fetched from the RAM.
The MDR holds the (a) which is being sent to/fetched from the address in the MAR.
The PC holds the address of the next (a) which will be fetched.
The PC is (a) by 1 at the end of each fetch-decode-execute cycle.
The ACC holds the result of any processing by the (a) .
The main purpose of the CPU is to run the _____-______-_______ cycle.
Please include the hyphens in your answer
(a)
The first stage of the Fetch-Decode-Execute cycle is:
The next instruction is fetched from the RAM
The instruction is decoded so that it can be done
Any processing is done using the ALU
The PC is incremented
The second stage of the Fetch-Decode-Execute cycle is:
The next instruction is fetched from the RAM
The instruction is decoded so that it can be done
Any processing is done using the ALU
The PC is incremented
The third stage of the Fetch-Decode-Execute cycle is:
The next instruction is fetched from the RAM
The instruction is decoded so that it can be done
Any processing is done using the ALU
The PC is incremented
The final stage of the Fetch-Decode-Execute cycle is:
The next instruction is fetched from the RAM
The instruction is decoded so that it can be done
Any processing is done using the ALU
The PC is incremented
Select the registers which hold memory addresses. [2]
RAM
MDR
ACC
PC
MAR
Select the registers. [3]
ALU
MDR
ACC
PC
CU
To get data from RAM, memory addresses are sent from the CPU down the...
bus.
registers.
ROM.
cache.
Select the components of the CPU. [2]
CU
ALU
ACC
ROM
PC
Which of these describes maintainability?
Making the program easier to use for the user
Making the code easier to read for the user
Making the code easier to read for the programmer
Making the program easier to use for the programmer
In order to explain what you mean to another programmer in words in the code you use...
Sub-Programs
Whitespace
Indentation
Comments
What word describes: giving variables names that reflect what their purpose is?
(a)
Which of these would you NOT use to add whitespace
spaces
indentation
extra variable names
empty lines
What maintainability term describes splitting code up into methods that perform some of the work?
(a)
Why is code indented?
To group together a function
The code does not use a { syntax and indentation is used instead
To make the code easier to read
All of the above
Which of these is not a method for authenticating a user?
Password
Password and Username
Finger print scanner
Encryption
When should comments be used within a program?
To help describe what code and structures are expected to do
To remind the developer if when lunch is
To include what tests must be carried out on the code
Every line, so that you know exactly what is happening
Which of the following are maintainability considerations - tick all that apply
authentication
comments
naming conventions
anticipating misuse
use of subprograms
Why do we want code to be maintainable?
To make code easy to edit by other programmers
To lessen the chance of mistakes when programming
To make it easier to make corrections to your own code
All of the above
The following is not true about variable names
They must be descriptive
They must be in capital letters
They can’t start with numbers or contain spaces
They point to memory locations
In an assignment operation, this appears on the right hand side
Label for a variable that is destination of data
Multiple variables that are destinations for data
Source variables or operations
The assignment operator
The following is not a valid constant
SPACE
PI
UserName
WORDLIMIT
Which of the following is a valid keyword for output?
SHOW
DISPLAY
INPUT
Consider the following expression: a:=b. This means
a will always be equal to b
b is being renamed into a
The value of memory location a gets copied into memory location b
The value of memory location b gets copied into memory location a
Which of the following is not a valid data type?
Real
String
Character
Fraction
Quotation marks around a variable’s identifier imply
It is an integer
It is a string
It is a Boolean
It is a real
The multiplication table is best displayed using this data type
Boolean
Character
Integer
Real
This variable type can only have True or False values
Boolean
Character
Integer
Real
Casting refers to:
Boolean algebra
Rounding of reals
Converting between variable data types
Printing out of the program’s results
The operator used to find if a number is divisible by another number:
Integer division
MOD
Division
Subtraction
The statement A OR B implies A and B are
Integers
Strings
Booleans
Characters
This function calculates the length of a string
UBOUND
INDEX
LEN
COUNT
The following is a correct way to use the MID function
A:=MID(“Flower”,”wer”)
A:=MID(4,“Flower”)
A:=MID(“Flower”,4)
A:=MID(“Flower”,4,2)
The following data types are used in selection conditions and while loops
Character
Boolean
Integer
String
The following is true about Top-down approach
The Main procedure is defined first, with other subs to follow
The detailed list of all operations is drawn up first, before planning
Start from top of program, complete the algorithm by getting to the bottom
Functions can’t be included as they can’t be directly called by procedures.
Structured code has the following benefit
Reduces the number of lines of code
Improves efficiency
Makes code easier to read and debug
All of these options are true
Variable scope refers to
Variable data type
Variable identifier
Logic errors associated with a variable
Different use of global and local variables
The advantages of parameter passing don’t include this
The same subprogram can be reused in more cases
Parameter passing makes it easier to use global variables
More flexible coding
Can cut down on the use of wasteful global variables
The main difference between procedures and functions is
Procedures are usually longer and have more instructions
Functions use parameter passing, while procedures don’t
Functions are more difficult to debug
Functions return values, while procedures don’t
When a variable first appears outside any subprograms
It is a global variable
It is a local variable
It is a parameter variable
It is not a valid variable
Converting procedures to functions usually causes these effects
Shorter code
Slows the program down
Reduction of the number of global variables, more parameter passing
Makes it more difficult to use selection
From this statement: a:=getChoice() we can see that
getChoice() is a function
getChoice() is a global variable
a is an array
getChoice() is a procedure
Trying to use a local variable from outside its scope will cause
A global variable to be overwritten by it
A wrong procedure to run
A crash with a report “Unknown variable”
A logical error
Identify a correct statement:
Global variables waste memory
showResults(choice,cutoff) is a function
An array index is its length
Nested iteration structures can share the same counter variable
ELSE IF keyword is used when
Our selection needs to work with more than three choices
Our selection needs to work with more than two choices
SELECT CASE/SWITCH statement is not available
Using conditional loops
Identify a correct statement:
SELECT CASE is more popular then IF/ELSE IF/ELSE
We can’t have more than 5 levels of nested IF/ELSE IF/ELSE
SELECT CASE is the same concept as SWITCH
FOR loops are known as condition-controlled iteration
In the nested selection statements
The inside selection structure gets executed first
The outside selection structure gets executed first
AND and OR are to be avoided
Integers must be used instead of Booleans
The flowchart shape for selection/decision is
Parallelogram
Square
Diamond
Rounded rectangle
Identify an invalid expression
ELSE x=45 THEN
IF x>9 and x<100 THEN
Any FOR loop can be rewritten as a WHILE loop
PROCEDURE Test(a AS INTEGER)
When a FOR loop increments a counter by a number other than one, this is called
Increment
Decrement
Stepping
Condition
For exiting FOR loops early we use
Nested iteration
BREAK clause
HALT clause
Conditional loops
The following is not true about arrays
All array elements have the same data type
Arrays have fixed size that can’t be easily changed during a program run
Names[LEN(Names)] is the last element of the array Names
The use of iteration makes arrays less relevant
The following is not a correct statement involving arrays
ARRAY Test[40]
ARRAY Test[56,34,89,8]
ARRAY:= Test[40]
NewArray:=SPLIT(MID(“War and Peace”,2,5),”,”)
The following is not a correct statement involving arrays
J:=Pupils[5,8]
Nums[i,j]:=Nums[i-1,j]
Nums[i,j]:=Nums[i-1]
B:=getChoices(45)
In Record structures, VARCHAR keyword means
A field is an integer
The name of the field is about to be changed
A field can be up to a certain number of characters or bytes in length
A field can be any number of characters or bytes in length
The following is true about Records
They must have an index
Fields are made up of records
Records can combine multiple data types in their fields
Record arrays are 2D arrays
SQL is used to work with files in this format
Plain text
Proprietary binary
CSV
Spreadsheets
The following is true about SQL
It has loops just like any other language
SQL is case sensitive
SQL is hard to read due to a lot of abbreviated keywords
SQL usually runs on top of another language
The purpose of SELECT * FROM Pupils WHERE Result>90 is
Retrieve collection of records of Pupils but only whose result is over 90
To retrieve a collection of records of Pupils but only whose result is 90
To set every Pupil’s result to 90
Retrieve a collection of records of Pupils but only whose name is over 90
Nested SELECT queries are used
When Boolean operators get too complex
When retrieving data from multiple tables
When using partial matching
For validation and quality control
When we read or write text files, we are working with this data type
Integers
Booleans
Reals
Strings
EOF is used in
To indicate the end of a line with a formatting delimiter
Conditional loops when writing to a file
Conditional loops when reading from a file
Destructive overwriting of the file’s data
The following is not a valid file open mode
Insert
Append
Read
Write
The following is not a reason to close files
The program will not run otherwise
Files kept open after we stopped needing them is wasted memory
If we don’t close a file, our program will keep on changing the data inside
A proper EOF will not be written
The following is true about working with text files
The file has to exist before we can write to it
The changes are saved when we write to it, not when we close the file
We use counter-controlled loops to read them
We read and write them one line at a time
The following is a right way to write to a file
myFile.READLINE(variable)
myFile.WRITELINE(variable)
myFile.APPENDLINE(variable)
myFile.INSERTLINE(variable)
The most appropriate file mode for creating a logbook
Read
Write
Append
Close
The following is a valid way to write a 2D array to a text file
Concatenate each row to a string with "," then, all rows with New Line char
Split the text file into an array, copy all elements to this array
Use SQL to convert 2D array to records first
All of these options are valid
