Font size
Worksheetsfunda
Total questions: 90
Worksheet time: 45mins
A computer system is a combination of:
Only hardware
Hardware and software that work together
Only software
Hardware refers to:
Software programs
Physical components of the computer
Data and instructions
Which of the following is NOT system software?
A – Operating System
B – Device Drivers
C – Google Docs
The three basic functions of a computer are:
A – Input, Output, Storage
B – Input, Process, Output
C – Output, Storage, Process
The CPU is responsible for:
Storing data
Processing data and instructions
Displaying output
A compiler is used to:
Translate source code to machine code
Store data
Display output
Machine language consists of:
Letters and symbols
Hexadecimal digits
Binary digits (0s and 1s)
The first step in the program development cycle is:
Coding
Testing
Understanding the problem
Flowcharts use a diamond shape for:
Start/End
Input/Output
Decision making
Pseudocode is:
A – A human-readable plan of the program logic
B – Machine code
C – Binary code
Variables are:
Fixed values
Named memory locations for data
Instructions
Constants are:
Values that can be changed
Values that cannot be changed
Instructions
The assignment operator (=) means:
Compare two values
Store the right-hand value into a variable
Add two values
Arithmetic operator for remainder:
+
-
%
Logical operator that checks both conditions:
A – ||
B – &&
C – !
The three main structures in structured programming:
A – Input, Output, Storage
B – Sequence, Selection, Loop
C – Variable, Constant, Operator
Spaghetti code means:
Well-organized code
Easy-to-read code
Disorganized, hard-to-read code
Logic gates are:
Software programs
Basic building blocks of digital circuits
Output devices
The AND gate outputs 1 only when:
One input is 1
Both inputs are 1
Any input is 1
The OR gate outputs 1 when:
Both inputs are 1
Both inputs are 0
Any input is 1
Looping allows a set of instructions to:
Run once only.
Repeat multiple times automatically.
Stop after one execution.
The main advantage of loops:
Reduce repetition and save time.
Make code longer.
Increase errors.
A definite loop means:
The number of repetitions is unknown.
The number of repetitions is known.
The loop never ends.
An indefinite loop means:
The number of repetitions is known.
The loop never ends.
The number of repetitions is unknown.
A loop control variable must be:
A – Initialized, tested, and updated.
B – Ignored.
C – Randomly changed.
Forgetting to update a loop variable causes:
Definite loop.
Loop to run once.
Infinite loop.
The for loop is used when:
You do not know how many times to loop.
You know exactly how many times to loop.
The loop never ends.
The while loop is a:
A – Posttest loop.
B – Pretest loop.
C – Infinite loop.
The do-while loop is a:
A – Pretest loop.
B – Infinite loop.
C – Posttest loop.
In pseudocode, 'FOR i = 1 TO 5' means:
Loop runs once.
Loop runs five times.
Loop never runs.
Nested loops are:
Loops that run once.
Loops inside other loops.
Infinite loops.
Common loop mistake: forgetting initialization causes:
Unpredictable results.
Loop runs once.
Loop never runs.
Wrong comparison operator may cause:
Loop to run once.
Loop to run more or fewer times than expected.
Loop never runs.
The purpose of loop validation is:
To make code longer.
To skip iterations.
To ensure input is valid before continuing.
A sentinel-controlled loop:
Stops when a specific value is entered.
Runs forever.
Skips iterations.
A counter-controlled loop:
Runs forever.
Uses a loop variable to track repetitions.
Skips iterations.
The keyword 'break' is used to:
Continue the loop.
Exit the loop immediately.
Skip iteration.
The keyword 'continue' is used to:
Stop the loop.
Skip current iteration and continue next.
Exit the loop.
Infinite loop means:
Loop that runs once.
Loop that never ends.
Loop that skips iterations.
Looping is preferred because:
It makes programs shorter and efficient.
It makes code longer.
It increases errors.
A while loop checks the condition before executing.
True
False
A do-while loop may never run.
True
False
For loops are ideal for unknown repetitions.
True
False
Nested loops can be used for tables.
True
False
Looping reduces redundancy in code.
True
False
Forgetting to update a counter is harmless.
True
False
Loops can be used for validation and calculations.
True
False
The loop body executes only once in a while loop.
True
False
A loop must always include an update step.
True
False
Posttest loops always execute at least once.
True
False
An array is: Choose the correct option.
A collection of elements with different data types.
A collection of elements with the same data type.
A single value.
A function.
Each element in an array is identified by: Choose the correct option.
A variable name.
A function.
An index number.
A value.
The first index in most programming languages is:
0
1
-1
2
Arrays allow you to: Choose the correct option.
Store a single value.
Store and access multiple values using one variable name.
Perform calculations.
None of the above.
A one-dimensional array stores: Choose the correct option.
Functions
Objects
Data in a single line or list
Multiple types
A two-dimensional array represents: Choose the correct option.
A single value
Rows and columns (like a table)
Functions
None of the above
The syntax to access the 3rd element in array 'A' is:
A. A[2]
B. A[3]
C. A(3)
D. A(2)
Array initialization means:
Deleting elements
Accessing elements
Giving starting values to elements
Sorting elements
Array traversal means:
Sorting elements
Accessing each element one by one
Initializing elements
Deleting elements
Arrays are useful because: Choose the correct option.
They simplify handling of related data
They are always faster
They use less memory
None of the above
Arrays can hold mixed data types.
True
False
The index of the last element is (size - 1).
True
False
Two-dimensional arrays need two indices.
True
False
Arrays cannot be used in loops.
True
False
Arrays help reduce multiple variable declarations.
True
False
Using a loop to display all array values is called:
Initializing the array.
Traversing the array.
Declaring the array.
To find the sum of array elements, you use:
Indexing.
Selection.
Accumulator with a loop.
The array element A[4] refers to:
The 4th element.
The 5th element.
The last element.
A two-dimensional array can be visualized as:
A – A matrix or table.
B – A list.
C – A single value.
Accessing data from 2D array needs:
One index.
Three indices.
Two indices (row and column).
Arrays are stored in:
Separate memory locations.
Contiguous memory locations.
Random memory locations.
The length or size of an array:
Is always 10.
Is always 1.
Tells how many elements it can hold.
Out-of-bounds error occurs when:
Accessing an index beyond the array size.
Accessing the first element.
Accessing the last element.
Initializing an array without values gives:
Random values.
Default values (e.g., 0).
Error.
To input array values from user:
Use a loop with input inside.
Use a single input.
Use a function.
You can use nested loops for 2D arrays.
True
False
Arrays can be used to store student grades.
True
False
You can declare an array with size 0.
True
False
Arrays can hold text data using strings.
True
False
Arrays are fixed in size once declared.
True
False
Which structure repeats until a condition becomes false?
Selection.
Loop.
Declaration.
Which structure makes decisions based on conditions?
Loop.
Declaration.
Selection.
The keyword used to declare an array:
Depends on language (e.g., int, string).
array
varray
arr
To stop a loop early, use:
Continue.
Selection.
Break.
To skip one iteration, use:
Break.
Continue.
Selection.
The process of debugging means:
Finding and fixing errors.
Writing code.
Designing algorithms.
Testing programs.
Logical operator for OR: ________
||
&&
!
==
Logical operator for NOT: ________
!
&&
||
==
Flowcharts can show loop structures.
True
False
Programming requires planning before coding.
True
False
