NEW
Font size
WorksheetsKSCS
Total questions: 25
Worksheet time: 13mins
Which statement type is used to declare a variable?
Assignment
Iteration
Variable declaration
Selection
Why are named constants and variables used?
To make programs more complicated
To improve program performance
To store and manipulate data
To confuse programmers
Which type of iteration is also known as count-controlled iteration?
Definite iteration
Indefinite iteration
Nested iteration
Iterative selection
Which statement type is used to combine multiple statements in a specific order?
Assignment
Iteration
Selection
Sequence
What is the purpose of nested selection structures?
To repeat a block of code until a condition is met
To execute different blocks of code based on conditions
To combine variables and constants in a program
To confuse programmers
Which statement type is used to define a constant?
Assignment
Iteration
Variable declaration
Constant declaration
Which statement type is used to repeat a block of code until a condition is met?
Assignment
Iteration
Selection
Subroutine
Which statement type is used to call a reusable piece of code?
Assignment
Iteration
Selection
Subroutine
Which data structure is used to store multiple values of the same type?
Arrays
Records
Constants
Subroutines
Which data structure is used to store multiple values of different types?
Arrays
Records
Constants
Subroutines
What is the maximum number of bits allowed per binary number when adding them together?
4
8
16
Unlimited
In binary shifts, which type of shift is commonly used?
Arithmetic shift
Logical shift
Circular shift
Fractional shift
What can binary shifts be used for?
Simple multiplication/division by powers of 2
Sorting data in ascending order
Encryption and decryption of data
Binary-to-decimal conversion
Why is hexadecimal often used in computer science?
It is the simplest number base to understand
It is the fastest number base for computations
It is more compact and easier to represent binary data
It is required for advanced cryptography algorithms
What is the maximum decimal value that can be represented in binary using 8 bits?
127
255
512
1024
What is the maximum decimal value that can be represented in hexadecimal using 2 digits?
15
25
99
255
How do you access an element in a two-dimensional array with indices (i, j)?
array[i, j]
array[i][j]
array(i, j)
array(i)(j)
What is the purpose of using records in programming?
To store a large number of values efficiently
To perform complex calculations
To organize and manage related data items together
To execute a series of instructions repeatedly
How can you check if a given string 'my_string' is empty in Python?
if my_string == ""
if my_string is None
if len(my_string) == 0
if not my_string
What does the range() function in Python do?
Generates a sequence of numbers
Performs mathematical calculations
Checks if a value is within a specified range
Executes a block of code repeatedly
How do you read user input from the console in Python?
readline()
input()
get_input()
console_input()
What is the output of the following code snippet?
[1, 2, 3, 4, 5]
[1, 4, 9, 16, 25]
[1, 8, 27, 64, 125]
[2, 4, 6, 8, 10]
What is the value of 'y' after executing the following code snippet?
5
10
True
False
What is the output of the following code snippet?
"World"
"Hello"
" "
"Hello,"
What will be the output of the following code snippet?
0
1
2
4
