WorksheetsUnit 1 Principles of Computer Science Revision
Total questions: 200
Worksheet time: 3hrs 20mins
Name
Class
Date
1.
What is decomposition in computational thinking?
a)
Writing code in different languages
b)
Breaking down problems into smaller parts
c)
Removing bugs from programs
d)
Compiling code into machine language
2.
Which of the following is an example of decomposition?
a)
Testing a complete program
b)
Breaking a game into levels, characters, and scoring
c)
Writing all code in one function
d)
Compiling source code
3.
Why is decomposition useful in problem solving?
a)
It makes problems harder to understand
b)
It makes problems easier to manage and solve
c)
It increases code execution time
d)
It requires more memory
4.
In developing a car parking system, which is an example of decomposition?
a)
Writing all code in one file
b)
Separating into ticket issuing, payment, and barrier control
c)
Using only one variable
d)
Avoiding functions
5.
What is the first step in decomposition?
a)
Writing the code
b)
Identifying the main problem
c)
Testing the solution
d)
Documenting the results
6.
How does decomposition help with team projects?
a)
It makes everyone do the same task
b)
It allows different team members to work on separate parts
c)
It prevents collaboration
d)
It increases confusion
7.
Which statement best describes decomposition?
a)
Combining simple problems into complex ones
b)
Breaking complex problems into simpler sub-problems
c)
Testing code for errors
d)
Documenting code thoroughly
8.
In a school database system, decomposition would involve:
a)
Creating one large program file
b)
Separating students, teachers, courses, and timetables
c)
Using only one table
d)
Avoiding any structure
9.
What happens after decomposing a problem?
a)
The problem becomes impossible
b)
Each part is solved separately then combined
c)
Nothing further is needed
d)
Start from the beginning
10.
Decomposition makes debugging easier because:
a)
There are no bugs in decomposed code
b)
Errors can be isolated to specific components
c)
Bugs disappear automatically
d)
It prevents all errors
11.
Which is NOT a benefit of decomposition?
a)
Easier to understand
b)
Promotes code reuse
c)
Makes code more complex
d)
Enables parallel development
12.
When designing a calculator, decomposition involves:
a)
One function for everything
b)
Separate functions for add, subtract, multiply, divide
c)
No functions at all
d)
Only addition
13.
Decomposition is applied during which phase?
a)
Only during testing
b)
During problem analysis and design
c)
Only after coding
d)
Never applied
14.
In an e-commerce system, order processing could decompose into:
a)
One single step
b)
Validation, payment, inventory update, shipping
c)
Only payment
d)
Random processes
15.
The main goal of decomposition is to:
a)
Make problems harder
b)
Make problems manageable by reducing complexity
c)
Increase the number of bugs
d)
Delay project completion
16.
What is pattern recognition in computational thinking?
a)
Finding similar features in problems
b)
Creating new patterns
c)
Writing repetitive code
d)
Testing code patterns
17.
Which scenario demonstrates pattern recognition?
a)
Writing unique code for each task
b)
Noticing that all login systems need username and password validation
c)
Using different approaches for similar problems
d)
Avoiding code reuse
18.
How does pattern recognition help in programming?
a)
It makes code run faster
b)
It allows code reuse and efficiency
c)
It increases memory usage
d)
It complicates the solution
19.
In a game, noticing that multiple enemies move in the same way is an example of:
a)
Decomposition
b)
Pattern recognition
c)
Abstraction
d)
Algorithm design
20.
What can you do after identifying patterns?
a)
Ignore them
b)
Create reusable solutions
c)
Make the code more complex
d)
Remove all functions
21.
Recognizing that all forms need input validation is:
a)
Abstraction
b)
Pattern recognition
c)
Decomposition
d)
Testing
22.
Pattern recognition helps predict:
a)
Future behaviors based on identified patterns
b)
Random outcomes
c)
Compilation errors
d)
Hardware failures
23.
Which is an example of pattern recognition in sorting?
a)
Every item is sorted differently
b)
The same comparison logic applies to all items
c)
Sorting is random
d)
No patterns exist
24.
In data processing, pattern recognition might identify:
a)
Unique cases only
b)
Common data formats and structures
c)
Random variations
d)
Compilation errors
25.
Pattern recognition differs from decomposition because:
a)
They are the same thing
b)
Pattern recognition finds similarities; decomposition breaks down problems
c)
Pattern recognition is older
d)
Decomposition is faster
26.
Identifying that multiple functions need error handling is:
a)
Decomposition
b)
Pattern recognition
c)
Testing
d)
Documentation
27.
Pattern recognition in loops involves:
a)
Writing different code each time
b)
Recognizing repetitive actions that can be automated
c)
Avoiding loops
d)
Random iteration
28.
When you notice multiple reports need similar formatting:
a)
Format each differently
b)
This is pattern recognition; create a template
c)
Avoid formatting
d)
Use random formats
29.
Pattern recognition leads to:
a)
More repetitive code
b)
More efficient, reusable solutions
c)
Slower execution
d)
More bugs
30.
In web development, recognizing all pages need navigation is:
a)
Pattern recognition
b)
Decomposition
c)
Abstraction
d)
Testing
31.
What is abstraction in computational thinking?
a)
Adding more details to a problem
b)
Removing unnecessary details to focus on important information
c)
Making code longer
d)
Testing all variables
32.
Which of the following is an example of abstraction?
a)
Including every detail in a model
b)
Using a variable to represent a customer's age
c)
Writing repetitive code
d)
Avoiding functions
33.
In pattern generalisation and abstraction, what do you identify?
a)
Only constants
b)
Variables, constants, inputs, and outputs
c)
Only outputs
d)
Only repeated processes
34.
Why is abstraction important in programming?
a)
It makes code more complex
b)
It simplifies problems by hiding unnecessary details
c)
It increases execution time
d)
It prevents code reuse
35.
What information might you filter out using abstraction for a student record?
a)
Student's grade level
b)
Student's favorite color
c)
Student's ID number
d)
Student's enrolled courses
36.
Abstraction helps programmers by:
a)
Adding complexity
b)
Allowing them to focus on relevant details
c)
Requiring more code
d)
Slowing development
37.
In a car program, abstraction might represent:
a)
Every molecule in the engine
b)
Key properties like speed, fuel level, and position
c)
The manufacturing process
d)
The color of each bolt
38.
Abstraction layers in programming:
a)
Make everything visible
b)
Hide implementation details behind simpler interfaces
c)
Prevent code execution
d)
Are not useful
39.
When creating a banking system, abstraction would:
a)
Include every transaction detail in every function
b)
Focus on essential operations like deposit, withdraw, balance
c)
Show all internal calculations everywhere
d)
Prevent any operations
40.
What is data abstraction?
a)
Showing all data details
b)
Representing data by its essential characteristics
c)
Deleting all data
d)
Copying data
41.
Functions provide abstraction by:
a)
Exposing all internal workings
b)
Hiding complex implementation behind a simple interface
c)
Preventing code reuse
d)
Increasing code size
42.
In abstraction, constants represent:
a)
Changing values
b)
Fixed values essential to the problem
c)
Random numbers
d)
User input
43.
Identifying key processes in abstraction means:
a)
Including every minor detail
b)
Determining which operations are essential to solve the problem
c)
Avoiding all processes
d)
Random selection
44.
Abstraction in object-oriented programming:
a)
Shows all class internals
b)
Hides internal state behind public methods
c)
Prevents creating objects
d)
Makes code longer
45.
The opposite of abstraction would be:
a)
Simplification
b)
Including every unnecessary detail
c)
Pattern recognition
d)
Decomposition
46.
What is an algorithm?
a)
A programming language
b)
A step-by-step procedure to solve a problem
c)
A type of variable
d)
A hardware component
47.
Which of the following best describes algorithm design?
a)
Randomly writing code
b)
Creating a logical sequence of steps to solve a problem
c)
Testing hardware
d)
Formatting text
48.
An algorithm should be:
a)
Ambiguous and unclear
b)
Clear, precise, and finite
c)
Infinitely long
d)
Hardware-dependent
49.
Which is an example of an algorithm?
a)
A computer monitor
b)
A recipe for baking a cake
c)
A keyboard
d)
A mouse
50.
What is the purpose of algorithm design?
a)
To make problems harder
b)
To create an efficient solution strategy
c)
To increase code size
d)
To avoid planning
51.
A good algorithm must have:
a)
Unclear steps
b)
Definite input and output
c)
Infinite loops
d)
No structure
52.
Algorithm efficiency refers to:
a)
Code length
b)
Time and space resources used
c)
Number of variables
d)
Color of code
53.
Before coding, algorithm design helps:
a)
Skip planning
b)
Think through the solution logically
c)
Write random code
d)
Avoid testing
54.
Which describes a well-designed algorithm?
a)
Works for some cases only
b)
Handles all valid inputs correctly
c)
Crashes randomly
d)
Has infinite loops
55.
Algorithm design is part of:
a)
Testing phase
b)
Planning and design phase
c)
Maintenance phase
d)
Deployment phase
56.
What makes an algorithm deterministic?
a)
Random outputs
b)
Same input always produces same output
c)
Different results each time
d)
No outputs
57.
An algorithm must be:
a)
Infinite
b)
Finite (must eventually stop)
c)
Random
d)
Unpredictable
58.
In algorithm design, edge cases are:
a)
Normal inputs
b)
Extreme or unusual inputs that test boundaries
c)
Ignored inputs
d)
Random inputs
59.
Correctness in algorithms means:
a)
Fast execution
b)
Produces correct output for all valid inputs
c)
Uses minimal memory
d)
Has no comments
60.
Algorithm design notation includes:
a)
Only machine code
b)
Pseudocode and flowcharts
c)
Only binary
d)
Only comments
61.
What is pseudocode?
a)
A programming language
b)
A simplified, language-agnostic way to express algorithms
c)
Machine code
d)
Assembly language
62.
Which is a valid pseudocode operation?
a)
PRINT 'Hello'
b)
#include <stdio.h>
c)
System.out.println
d)
console.log
63.
What does BEGIN and END represent in pseudocode?
a)
Loop boundaries
b)
The start and end of a program or procedure
c)
Variable declarations
d)
Comment markers
64.
Which pseudocode statement is used for input?
a)
OUTPUT
b)
WRITE
c)
INPUT or READ
d)
PRINT
65.
How do you output information in pseudocode?
a)
INPUT
b)
READ
c)
OUTPUT, PRINT, or WRITE
d)
GET
66.
What is the purpose of indentation in pseudocode?
a)
To make it look nice
b)
To show structure and hierarchy
c)
To confuse readers
d)
It has no purpose
67.
Which statement shows sequence in pseudocode?
a)
IF...THEN
b)
FOR loop
c)
Step 1, Step 2, Step 3
d)
WHILE
68.
In pseudocode, what does 'IF...THEN...ELSE' represent?
a)
Repetition
b)
Decision making
c)
Input
d)
Output
69.
What does 'WHILE' indicate in pseudocode?
a)
A decision
b)
A loop that repeats while a condition is true
c)
An input command
d)
The end of the program
70.
Which loop is best when you know how many times to repeat?
a)
WHILE
b)
FOR
c)
IF
d)
REPEAT UNTIL
71.
Pseudocode is language-agnostic, meaning:
a)
It's written in English only
b)
It's independent of any specific programming language
c)
It only works in Python
d)
It's machine code
72.
What does REPEAT UNTIL mean in pseudocode?
a)
Never repeat
b)
Repeat until the condition becomes true
c)
Repeat while true
d)
Repeat once
73.
In pseudocode, assignment is shown as:
a)
variable = value or variable ← value
b)
variable == value
c)
variable != value
d)
value = variable
74.
Comments in pseudocode are often indicated by:
a)
Nothing
b)
// or # symbols
c)
BEGIN COMMENT
d)
OUTPUT
75.
ELSEIF in pseudocode allows:
a)
No additional conditions
b)
Checking multiple conditions in sequence
c)
Only two conditions total
d)
Infinite conditions
76.
Pseudocode helps with:
a)
Compilation
b)
Planning logic before coding
c)
Running programs
d)
Hardware testing
77.
What is the benefit of using pseudocode?
a)
It executes faster
b)
It focuses on logic without syntax concerns
c)
It's required by computers
d)
It's a programming language
78.
FOR i = 1 TO 10 STEP 2 in pseudocode means:
a)
Count from 1 to 10 by 2s (1,3,5,7,9)
b)
Count from 2 to 10
c)
Count from 1 to 5
d)
Count backwards
79.
Pseudocode is used during:
a)
Testing only
b)
Design and planning stages
c)
Deployment only
d)
Hardware installation
80.
Which is NOT a pseudocode operation?
a)
INPUT
b)
OUTPUT
c)
int main()
d)
WHILE
81.
What shape represents the start/end in a flowchart?
a)
Rectangle
b)
Diamond
c)
Oval/Terminator
d)
Parallelogram
82.
What does a diamond shape represent in a flowchart?
a)
Process
b)
Decision
c)
Input/Output
d)
Start/End
83.
What does a rectangle represent in a flowchart?
a)
Decision
b)
Process or action
c)
Input/Output
d)
Connector
84.
What shape is used for input/output in a flowchart?
a)
Rectangle
b)
Diamond
c)
Parallelogram
d)
Circle
85.
What do arrows represent in a flowchart?
a)
Variables
b)
Flow of control
c)
Data storage
d)
Comments
86.
Which symbol is used as a connector in flowcharts?
a)
Square
b)
Triangle
c)
Small circle
d)
Star
87.
What is the purpose of a flowchart?
a)
To make code run faster
b)
To visually represent the flow of a program
c)
To compile code
d)
To test hardware
88.
When creating a flowchart, what should you do first?
a)
Draw random shapes
b)
Identify start and end points
c)
Add colors
d)
Write code
89.
What follows a decision diamond in a flowchart?
a)
Only one path
b)
At least two paths based on the condition
c)
No paths
d)
A circle
90.
British Computer Society (BCS) symbols are:
a)
Random shapes
b)
Standardized flowchart symbols
c)
Programming language keywords
d)
Hardware components
91.
In a flowchart, flow generally moves:
a)
Only left to right
b)
Top to bottom and left to right
c)
Bottom to top only
d)
Randomly
92.
A decision diamond must have:
a)
One exit path
b)
At least two exit paths
c)
No exit paths
d)
Exactly three paths
93.
Flowcharts help programmers:
a)
Write faster code
b)
Visualize logic before coding
c)
Skip testing
d)
Avoid documentation
94.
A loop in a flowchart is shown by:
a)
No connection
b)
Arrows pointing back to earlier steps
c)
Multiple start points
d)
No arrows
95.
Which is NOT a standard BCS flowchart symbol?
a)
Rectangle (Process)
b)
Diamond (Decision)
c)
Parallelogram (Input/Output)
d)
Star (Random)
96.
Which data type stores whole numbers?
a)
Float
b)
Integer
c)
String
d)
Boolean
97.
Which data type stores text?
a)
Integer
b)
Float
c)
String
d)
Boolean
98.
What does a Boolean data type store?
a)
Numbers
b)
Text
c)
True or False values
d)
Decimal numbers
99.
Which data type would you use for 3.14159?
a)
Integer
b)
String
c)
Boolean
d)
Float/Real
100.
What is the difference between integer and float?
a)
No difference
b)
Float can store decimal numbers
c)
Float stores text
d)
Integer stores True/False
101.
Which data type would store a person's age?
a)
String
b)
Boolean
c)
Integer
d)
Character
102.
What is a character data type?
a)
Multiple words
b)
A single letter, digit, or symbol
c)
True or False
d)
A whole number
103.
Which data type stores dates?
a)
String
b)
Integer
c)
Date/Time
d)
Boolean
104.
What would you use to store whether a student passed or failed?
a)
Integer
b)
String
c)
Boolean
d)
Float
105.
An array stores:
a)
Only one value
b)
Multiple values of the same type
c)
Only Boolean values
d)
Only text
106.
What is the correct format for a string?
a)
123
b)
True
c)
'Hello World'
d)
3.14
107.
Which data type would you use for a phone number?
a)
Integer
b)
String
c)
Boolean
d)
Float
108.
What type of data is stored in: isComplete = True?
a)
Integer
b)
String
c)
Boolean
d)
Float
109.
Which stores decimal numbers with high precision?
a)
Integer
b)
Character
c)
Float/Double
d)
Boolean
110.
What is a record in programming?
a)
A single data value
b)
A collection of different data types grouped together
c)
An array
d)
A loop
111.
Sets in programming:
a)
Allow duplicate values
b)
Store unique values only
c)
Store only numbers
d)
Cannot be modified
112.
Which data type is best for storing currency?
a)
Integer
b)
String
c)
Float/Decimal
d)
Boolean
113.
An object in programming:
a)
Stores only numbers
b)
Can contain properties and methods
c)
Is always a string
d)
Cannot be modified
114.
What is a null or None value?
a)
Zero
b)
Empty string
c)
Absence of a value
d)
False
115.
Multi-dimensional arrays:
a)
Store only one value
b)
Can have multiple rows and columns
c)
Store only text
d)
Are not used in programming
116.
What is a variable?
a)
A constant value
b)
A named storage location that can change
c)
A function
d)
A loop
117.
What is the difference between local and global variables?
a)
No difference
b)
Local variables are limited to a specific scope; global variables are accessible everywhere
c)
Global variables are faster
d)
Local variables use more memory
118.
Why are local variables preferred over global variables?
a)
They use less memory and reduce conflicts
b)
They are slower
c)
They cannot be used
d)
They are more complex
119.
What is a constant?
a)
A value that changes
b)
A value that never changes
c)
A type of loop
d)
A decision structure
120.
Which naming convention is recommended for variables?
a)
random123
b)
descriptive names like studentAge
c)
single letters only
d)
spaces in names
121.
Can a variable name start with a number?
a)
Yes, always
b)
No, it must start with a letter or underscore
c)
Only in some languages
d)
Yes, but only in Python
122.
What happens if you try to use an undeclared variable?
a)
It works fine
b)
You get an error
c)
It automatically creates the variable
d)
Nothing happens
123.
Variable scope refers to:
a)
The size of the variable
b)
Where the variable can be accessed
c)
The variable's data type
d)
How fast the variable works
124.
What is variable initialization?
a)
Deleting a variable
b)
Declaring a variable
c)
Assigning an initial value to a variable
d)
Printing a variable
125.
Which is a valid variable name?
a)
2ndPlace
b)
student-name
c)
student_name
d)
student name
126.
What does declaring a variable mean?
a)
Using the variable
b)
Telling the program about the variable's existence and type
c)
Deleting the variable
d)
Printing the variable
127.
Global variables can lead to:
a)
Faster code
b)
Conflicts and bugs when multiple functions modify them
c)
Better memory usage
d)
Simpler code always
128.
What symbol is commonly used for assignment?
a)
+
b)
=
c)
==
d)
*
129.
Can you change the value of a constant after declaration?
a)
Yes, anytime
b)
No, constants cannot be changed
c)
Only once
d)
Only in loops
130.
Variable shadowing occurs when:
a)
Variables are deleted
b)
A local variable has the same name as a global variable
c)
Variables are printed
d)
Variables are constants
131.
What does the + operator do?
a)
Subtraction
b)
Addition or concatenation
c)
Multiplication
d)
Division
132.
What does the - operator do?
a)
Addition
b)
Subtraction
c)
Multiplication
d)
Division
133.
What does the * operator do?
a)
Addition
b)
Subtraction
c)
Multiplication
d)
Division
134.
What does the / operator do?
a)
Addition
b)
Subtraction
c)
Multiplication
d)
Division
135.
What does the MOD or % operator do?
a)
Multiplication
b)
Division
c)
Returns the remainder after division
d)
Exponentiation
136.
What does the == operator do?
a)
Assignment
b)
Checks if two values are equal
c)
Addition
d)
Subtraction
137.
What does the != or <> operator mean?
a)
Equal to
b)
Not equal to
c)
Less than
d)
Greater than
138.
What does < mean?
a)
Greater than
b)
Less than
c)
Equal to
d)
Not equal to
139.
What does > mean?
a)
Less than
b)
Greater than
c)
Equal to
d)
Not equal to
140.
What does <= mean?
a)
Greater than
b)
Less than or equal to
c)
Not equal to
d)
Equal to
141.
What does >= mean?
a)
Less than
b)
Greater than or equal to
c)
Not equal to
d)
Equal to
142.
What does the AND operator do?
a)
Returns True if both conditions are true
b)
Returns True if either condition is true
c)
Inverts a condition
d)
Adds numbers
143.
What does the OR operator do?
a)
Returns True if at least one condition is true
b)
Returns True only if both are true
c)
Inverts a condition
d)
Subtracts numbers
144.
What does the NOT operator do?
a)
Adds values
b)
Inverts/reverses a Boolean value
c)
Multiplies values
d)
Checks equality
145.
If x = 5, what is x % 2?
a)
0
b)
1
c)
2
d)
5
146.
What is the result of 10 DIV 3 in integer division?
a)
3.333
b)
3
c)
4
d)
0
147.
Relational operators return what type of value?
a)
Integer
b)
String
c)
Boolean
d)
Float
148.
What is the order of operations in: 2 + 3 * 4?
a)
20
b)
14
c)
24
d)
12
149.
Boolean operators work with:
a)
Numbers only
b)
Text only
c)
True/False values
d)
Arrays only
150.
What does 'concatenation' mean for strings?
a)
Splitting strings
b)
Joining strings together
c)
Comparing strings
d)
Converting to uppercase
151.
What is an IF statement used for?
a)
Repetition
b)
Making decisions based on conditions
c)
Input
d)
Output
152.
What is the structure of an IF...THEN...ELSE statement?
a)
IF condition THEN action
b)
IF condition THEN action ELSE alternative
c)
FOR loop
d)
WHILE loop
153.
What is a loop?
a)
A decision structure
b)
A structure that repeats code multiple times
c)
An input operation
d)
A data type
154.
What is a FOR loop used for?
a)
Making decisions
b)
Repeating code a specific number of times
c)
Input only
d)
Output only
155.
What is a WHILE loop?
a)
Repeats while a condition is true
b)
Repeats a fixed number of times
c)
Makes decisions
d)
Declares variables
156.
What is a REPEAT UNTIL loop?
a)
Repeats while condition is true
b)
Repeats until a condition becomes true
c)
Never repeats
d)
Repeats infinitely
157.
What is the difference between WHILE and REPEAT UNTIL?
a)
No difference
b)
REPEAT UNTIL always runs at least once
c)
WHILE is faster
d)
REPEAT UNTIL is newer
158.
What is an infinite loop?
a)
A loop that runs exactly once
b)
A loop that never stops
c)
A loop with no code
d)
A very fast loop
159.
What does BREAK do in a loop?
a)
Starts the loop
b)
Exits the loop immediately
c)
Skips to next iteration
d)
Declares a variable
160.
Which loop is best when you don't know how many times to repeat?
a)
FOR
b)
WHILE or REPEAT UNTIL
c)
IF
d)
WHEN
161.
What is a nested loop?
a)
A loop inside another loop
b)
Two separate loops
c)
A loop with no code
d)
A broken loop
162.
In 'FOR i = 1 TO 10', how many times does the loop run?
a)
9
b)
10
c)
11
d)
1
163.
What is loop iteration?
a)
Ending a loop
b)
One complete execution of the loop body
c)
Starting a loop
d)
A loop error
164.
Can you have multiple ELSEIF statements?
a)
No, only one
b)
Yes, as many as needed
c)
Only two
d)
Only in Python
165.
What is a nested IF statement?
a)
An IF inside another IF
b)
Multiple unrelated IFs
c)
An IF with no ELSE
d)
A loop inside an IF
166.
Selection statements control:
a)
The flow of the program based on conditions
b)
How many times code repeats
c)
Variable declarations
d)
Program compilation
167.
What should you be careful about in WHILE loops?
a)
Using too many variables
b)
Ensuring the condition eventually becomes false
c)
Using colors
d)
Adding comments
168.
Loops are used for:
a)
Making decisions only
b)
Repeating code efficiently
c)
Declaring variables only
d)
Compiling programs
169.
Can loops be combined with IF statements?
a)
No
b)
Yes, very commonly
c)
Only in Python
d)
Only in C++
170.
What does 'loop until user enters quit' demonstrate?
a)
FOR loop
b)
Condition-controlled loop (WHILE or REPEAT UNTIL)
c)
Nested loop
d)
Infinite loop
171.
A loop counter is:
a)
A variable that tracks loop iterations
b)
A hardware component
c)
An error message
d)
A type of operator
172.
CONTINUE in a loop:
a)
Stops the loop
b)
Skips rest of current iteration and starts next one
c)
Declares a variable
d)
Prints output
173.
The ELSE clause in IF statements is:
a)
Mandatory
b)
Optional
c)
Always executed
d)
A loop
174.
IF x > 5 AND x < 10 checks:
a)
x is greater than 5 or less than 10
b)
x is between 5 and 10 (exclusive)
c)
x equals 5 or 10
d)
x is exactly 7.5
175.
Which loop structure always executes at least once?
a)
FOR
b)
WHILE
c)
REPEAT UNTIL
d)
IF
176.
What is a function?
a)
A loop
b)
A reusable block of code that performs a specific task
c)
A variable
d)
A data type
177.
What are parameters in a function?
a)
The output
b)
Values passed into the function
c)
The function name
d)
Loop counters
178.
What does a function return?
a)
Nothing always
b)
A result value back to the calling code
c)
Only errors
d)
Variable names
179.
Why are functions useful?
a)
They make code longer
b)
They promote code reuse and organization
c)
They slow down programs
d)
They are not useful
180.
What is an array?
a)
A single value
b)
A collection of values of the same type
c)
A function
d)
A loop
181.
How do you access array elements?
a)
By name
b)
By index/position number
c)
You cannot access them
d)
By color
182.
What is the first index in most programming arrays?
a)
1
b)
0
c)
-1
d)
It varies
183.
What is a 2D array?
a)
Two separate arrays
b)
An array with rows and columns
c)
An array of size 2
d)
A very small array
184.
What is data validation?
a)
Deleting data
b)
Checking data is reasonable and meets requirements
c)
Printing data
d)
Storing data
185.
What is range validation?
a)
Checking data is text
b)
Checking data falls within acceptable limits
c)
Checking data is unique
d)
Checking data is Boolean
186.
What is type validation?
a)
Checking data is the correct data type
b)
Checking data length
c)
Checking data is unique
d)
Checking data color
187.
Why is data validation important?
a)
It makes programs slower
b)
It prevents invalid data from causing errors
c)
It makes code longer
d)
It is not important
188.
What is a sorting algorithm?
a)
Deleting data
b)
Arranging data in a specific order
c)
Searching for data
d)
Printing data
189.
What is bubble sort?
a)
A searching algorithm
b)
A sorting algorithm that repeatedly swaps adjacent elements if they're in wrong order
c)
A data structure
d)
A validation technique
190.
What is a searching algorithm?
a)
Sorting data
b)
Finding specific data within a collection
c)
Deleting data
d)
Printing data
191.
What is linear search?
a)
Searching sorted data
b)
Checking each item sequentially until found
c)
A fast search method
d)
A sorting algorithm
192.
What is binary search?
a)
Searching unsorted data
b)
Efficiently searching sorted data by repeatedly dividing in half
c)
A sorting algorithm
d)
A slow search
193.
Binary search requires:
a)
Unsorted data
b)
Sorted data
c)
Small data only
d)
Text data only
194.
What is procedural programming?
a)
Programming with objects
b)
Programming with sequence of steps and procedures
c)
Programming for events
d)
Programming for web only
195.
What is object-oriented programming (OOP)?
a)
Programming with only functions
b)
Programming that uses objects containing data and methods
c)
Programming with only variables
d)
Programming without structure
196.
What is event-driven programming?
a)
Sequential execution only
b)
Program flow determined by events like user actions
c)
Programming without loops
d)
Programming without variables
197.
What is the benefit of code reusability?
a)
Longer code
b)
Saving time by using existing tested code
c)
Slower execution
d)
More bugs
198.
What makes code maintainable?
a)
Long variable names
b)
Clear structure, good documentation, and modularity
c)
No comments
d)
Complex logic
199.
A stack data structure is:
a)
First In First Out
b)
Last In First Out
c)
Random access
d)
Sorted order
200.
A queue data structure is:
a)
Last In First Out
b)
First In First Out
c)
Random access
d)
Sorted order
100 %
