Font size
WorksheetsJ277 Comp 2
Total questions: 114
Worksheet time: 3580secs
Draw the flow chart symbol for Process

Draw the Flow chart symbol for Decision

Draw the flow chart symbol for Sub Program

Draw the flow chart symbol for Terminal

Abstraction is:
adding to a problem
filtering out all irrelevant characteristics and unnecessary details
finding characteristics
looking for similarities
Click all that applies. Abstraction:
is a problem solving tool
removes unimportant information
adds important information
simplifies a situation
focuses on what is important
Before we can abstract, we first need to decompose the problem.
true
false
What is decomposition?
Breaking down a complex problem or system into smaller, more manageable parts
Adding detail to make a problem more complex
When you ignore the unnecessary detail in a problem
Why do we decompose a complex problem?
To make it more difficult to solve
To change the problem we have
To make it easier to solve
Which of these is an example of decomposition?
Watching a mechanic repair a bicycle
Looking at different bicycles for similarities between them
Finding out how a bicycle works by looking in detail at the different parts that make up the bicycle
Press keys in order to say MEOW.
CABD
ACDB
ADCB
CCDD
an ordered sequence of instructions that perform a specific task
An array
An algorithm
A barcode
A boolean
a series of variables of the same data type
An array
An algorithm
A bitmap
A byte
a number expressed in a base-2 number system. With a value of either 0 or 1
Boolean
Byte
Behavior
Binary Number
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'A' be?
1
3
5
7
Look at the Algorithm Below. In the corresponding Trace Table, what value should 'F' be?
5
8
13
18
What is the purpose of using a Trace table?
Planning before writing a program
To help debug a program
Check for spelling mistakes
Understand the program more
What are the main Type(s) of Test Data?
ERRONEOUS/ABNORMAL DATA and BOUNDARY DATA
Normal Test Data only
Boundary Data only
In which of the following cases, binary search algorithm is used?
To search an element in an unordered list.
To search an element in a list of few elements.
To search an element in any ordered list with large number of elements.
How does a binary search algorithm works?
Dividing the list into halves until the item is matched with one in the list.
Starts with the first element and checks the next element consecutively until a match is found.
None of the above
An array with 32 elements is input to a binary search algorithm. How many maximum number of comparisons are performed?
32
16
8
5
An array with 32 elements is input to a linear search algorithm. How many maximum number of comparisons are performed?
32
16
8
5
Complete the sentence: The lower half of the list is discarded if the value at midpoint is …………………….. item searched.
less than
greater than
equal to
True or False: The upper half of the list is discarded if the value at midpoint is greater than item searched.
True
False
12, 6, 8, 1, 3
How many searches would it take to find the number 1?
What is a Count-Controlled loop?
for loop
while loop
A count controlled loop will..
Repeat code until a condition is met
Repeat code a specific amount of times
Repeat code a random amount of times
None of the above
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
Which of these is NOT a loop in python?
for loop
while loop
nested loop
if loop
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
If i want to continuously check for a correct answer, what loop would i use?
for loop
while loop
What is the error in this code?
incorrect variable name
incorrect indentation
incorrect speech marks
incorrect loop
What is a % ?
what is a string?
any numeric value
any float value
any character value
any special symbol value
how we store string value in variable?
'string'
"string"
%string%
#sring#
For string symbol + means........................
addition
swapp
concatenation
multiplication
str1='101'
x=int(str1)
z=x+400
print(z)
101400
x400
501
none of above
fruit1="kiwi"
fruit2="strawberry"
print(len(fruit1))
print(len(fruit2))
kiwi and strawberry
4
10
4 10
410
slicing string X="BOnVoyage"
print X[0:5]
BOnVoy
BOnVo
oyage
bonvo
Slicing string
x="BOnvoyage
print(x[4: ])
BOnvo
bonvo
voyage
VOYAGE
python function
s=lower("INDIA)
print(s)
India
india
INDIA
INDIA
Mode in the following program to open file for writing in a mode where new data will be added at the end of old data
file =open("poem.txt","__")
r
w
a
r+
Choose the correct statement to close a file stream named myfile:
myfile.terminate()
myfile.end()
myfile.close()
myfile.remove()
What will be the output-
f=open('abc.txt','a')
text="xyz"
f.write(text)
f.close()
Writing into the file without erasing old content
Writing into the file by erasing old content
reading from the file without erasing old content
reading from the file by erasing old content
Which function is used to write multiple lines in text file?
write()
writelines()
lines()
print()
filename="example.txt"
with open(filename, "w") as myfile:
myfile.write("Pershendetje")
What happens here?
a file called 'example' is being read
a file called 'example' is created and some text is saved in it.
The text in the 'example' file is assigned to a variable
a variable called filename is created and it's value is printed on a file
Which statement is correct for adding the value 5 to a list called x?
x.add(5)
x.append(5)
x.pop(5)
x.insert(5)
What does a range check do?
Checks data across a range of numbers
Checks the data is within an acceptable range
Sorts numbers into ascending order
Checks that the data is in the correct format
What does a length check do?
Checks the data entered is of the correct format
Checks data has been entered
Checks that data has the correct number of characters
Checks data is within the correct range
What is data validation?
Checking that the data entered is wrong
Checking that the data entered is correct
Checking that the data entered is sensible or reasonable
When is terminal testing carried out?
Before you start
At the end
During the project
After the design section
Why is code indented?
To group together a function
The code may not use a { syntax and indentation is used instead
To support code maintainability
All of the above
Which of these is not a feature of a test plan?
The data entered
The type of test data
If the testing is terminal or iterative
The expected outcome
The result of the test
When is a runtime error identified?
After the program is executed
Before a program runs
While the program runs
Which line contains a syntax error?
print ("hello")
print ("Hello")
print ("hello)
print ("HELLO")
What is iterative testing?
Testing completed after an error is found
Random test on a computer program
Tests completed as the program is being coded
Tests which are planned
When a program runs it asks the user to enter their first name. Which is an example of valid data?
Mr Jones
Sarah
Sarah Jones
Mrs Jones
When a program runs it asks the user to enter their age. Which data would be most suitable to test for an incorrect piece of data being entered?
44
1
97
Forty Five
The program below prints well done if the score is higher than 80:
if score < 80:
print ("Well done")
Logic error
Data error
Text error
Syntax error
Which is not the name of a group of test data that you would use in a test plan?
Valid data
Range data
Nil value data
Average data
What is the output of an OR gate if the inputs are 1 and 0?
0
1
OFF
2
What is the output of an AND gate if the inputs are 1 and 0?
0
1
ON
2
What is the output of a NOT gate if the input is 0?
0
1
OFF
2
A NOT gate has...
Two inputs and one output
One input and one output
One input and two outputs
Two inputs and two outputs
An OR gate has...
Two inputs and one output
One input and one output
One input and two outputs
Two inputs and two outputs
The output of any logic gate can have either of two
Gates
States
Inputs
Outputs
A logic state can only be....
On or 1
Off or 1
1 or 0
In and Out
The output of a gate is only 1 when both inputs are 1
OR
NOT
NAND
AND
A NAND gate is the combination of which two gates
OR and AND
AND and NOT
NOT and OR
OR and NAND
Which of these is a definition of a transistor
Microscopic devices that open and close circuits to communicate electrical signals.
A device used to change a circuit
A type of gate used in a CPU
Circuit components which take several inputs
State the output of the following circuit....
0
1
State the output of the following circuit
0
1
Problem-based programming languages which are similar to natural languages
(a)
Problem-based programming languages which are short simple mnemonic commands
(a)
Code which is in a format a CPU can understand
(a)
Utility which converts high-level code into low-level code, one line at a time
(a)
Utility which converts high-level code into low-level code, whole blocks of code at a time
(a)
Utility which converts assembly code into low-level code
(a)
The part of an IDE where code is entered
(a)
Software feature used by developers to help detects bugs in the source code
(a)
Name for the utility which converts programming code into machine code
(a)
A process of debugging where code is executed one instruction or line at a time
(a)
