Computer Science for IGCSE & O level - Programming (Section 1)
1
What is the function of a 'variable'?
2
In the given pseudo-code, which statement is responsible for displaying output to the user?
3
Which of the following features are commonly found in programming languages to facilitate file handling?
4
In Python, how do you open a file to read its content?
پاسخ دهید(B)
open("filename.txt", "r")
5
In the program provided, which concept demonstrates an example of abstraction?
پاسخ دهید(A)
Using MOD and DIV library routines.
6
Which of these programming elements is most often used to handle decision making in code?
پاسخ دهید(C)
Conditional statements (IF/ELSE)
7
What does the `continue` statement do within a loop?
پاسخ دهید(B)
Skips the rest of the current iteration and goes to the next iteration.
8
What is the main goal of writing maintainable code?
پاسخ دهید(C)
To make the code easier to understand, modify, and debug over time.
9
What will happen if you try to access a local variable outside of its scope?
پاسخ دهید(B)
The program will generate an error.
10
What does the keyword `RETURN` typically do in a function?
پاسخ دهید(D)
It specifies the value that the function will give back.
11
Which of the following is an example of a valid output statement?
12
What is a benefit of breaking down a complex problem into smaller sub-problems in programming?
13
When writing pseudocode, which action should you avoid to improve code readability?
پاسخ دهید(D)
Using unnecessarily complex or ambiguous logic.
14
Which of the following is a critical element in the design of efficient and reliable programs?
پاسخ دهید(C)
Applying the principles of modularity.
15
What is the name of the programming paradigm that contains procedures?
16
In the given examples, which type of loop is more similar to the `REPEAT...UNTIL` loop?
پاسخ دهید(C)
Post-condition (DO...WHILE) loop
17
In pseudo-code, what does an `IF` statement generally do?
پاسخ دهید(C)
Make a decision based on a condition
18
In the example, what is the function of `MOD`?
پاسخ دهید(B)
To return the remainder after division.
19
Which of the following is used to represent 'not equal to' in most programming languages?
20
What is a key characteristic of a function?
پاسخ دهید(B)
It always returns a value.
21
What is the meaning of 'algorithm'?
پاسخ دهید(C)
A set of steps to solve a problem.
22
Which operator is used to check if two values are equal?
23
Which programming element is essential for creating modular programs?
24
Consider an array declaration in pseudocode: `DECLARE myArray : ARRAY[0:9] OF INTEGER`. What does the number 9 represent?
پاسخ دهید(B)
The last index of the array.
25
What actions will need to occur to store data persistently?
26
What does the acronym API stand for?
پاسخ دهید(B)
Application Programming Interface
27
What is 'syntax' in the context of programming?
پاسخ دهید(B)
The rules for writing the code.
28
In the context of the provided code snippets, what could `studentAverage` represent?
پاسخ دهید(B)
The average mark of a single student.
29
What do parameters within functions or procedures do?
پاسخ دهید(B)
They pass data into the function or procedure.
30
In programming, what is a 'constant'?
پاسخ دهید(B)
A value that cannot be changed during program execution.
31
In the pseudo-code, how are comments typically used to clarify the program's logic?
پاسخ دهید(B)
Comments provide explanatory notes within the code.
32
What is the significance of the data type associated with a variable?
پاسخ دهید(C)
It determines the type of values the variable can hold and the operations that can be performed on it.
33
What is the role of an algorithm in programming?
پاسخ دهید(D)
To provide a step-by-step procedure for solving a problem.
34
If `Value2 = DIV(17, 3)`, what is the value of `Value2`?
35
Which data type is best suited for storing whole numbers?
36
What is the purpose of the `try...except` block in Python?
پاسخ دهید(B)
To handle potential errors and exceptions.
37
In the given examples, which data type is used to store whole numbers?
38
What are the characteristics of a good identifier name in a program?
39
What does the term 'parameter' refer to in the context of a function?
پاسخ دهید(B)
The input values the function uses.
40
Which variable(s) are likely to be declared as global variables?
41
What is the main difference between constants and variables?
پاسخ دهید(C)
Variables can be changed during program execution, constants cannot.
42
What is the purpose of an `ELSE` statement when used with an `IF` statement?
پاسخ دهید(A)
To execute a block of code if the `IF` condition is false.
43
What is the primary function of a compiler or interpreter?
پاسخ دهید(B)
To translate the source code into machine-executable code.
44
In Visual Basic, how do you begin a program?
45
What are library routines?
پاسخ دهید(B)
Pre-written code modules that perform specific tasks.
46
In pseudo-code examples, what does the `NumberStudents` constant likely represent in the context of a student mark calculation program?
پاسخ دهید(C)
The total number of students whose marks are being processed.
47
What does an algorithm constitute in programming?
پاسخ دهید(B)
The set of steps to solve a problem.
48
Which keyword is used in Java to begin the program?
49
Which of the following can store multiple data types?
50
What is the primary purpose of the `IF-THEN-ELSE` construct in programming?
پاسخ دهید(C)
To control the flow of execution based on a condition.