Computer Science for IGCSE & O level - Programming (Section 11)
1
Which statements are always part of a function definition?
2
What is the most common way to handle a file if an error is detected?
3
What does the MOD function return?
پاسخ دهید(C)
The remainder of a division
4
What does a Selection statement enable a program to do?
پاسخ دهید(C)
Make choices based on conditions.
5
What does the step value of a FOR loop determine?
پاسخ دهید(C)
The increment or decrement applied to the loop variable in each iteration.
6
What is the basic definition of a variable?
پاسخ دهید(C)
A named storage for data.
7
Which of these is NOT a part of a well-structured program?
8
What does the code snippet `OUTPUT
پاسخ دهید(C)
Displays 'Enter some value' on the screen.
9
What does the symbol '%' represent in programming contexts (as used in the provided image)?
پاسخ دهید(B)
Modulo (remainder after division)
10
Which of the following is an example of file handling in the context of this document?
پاسخ دهید(B)
Reading data from a file.
11
Which of the following is a recommended practice for creating a maintainable program?
12
What operations are common in programming?
13
In nested IF-ELSE statements, what is the relationship between the outer and inner blocks of code?
پاسخ دهید(B)
The inner block executes only if the outer block's condition is met.
14
In the totaling example, how does the code update the total weight?
پاسخ دهید(C)
By adding Weight to TotalWeight.
15
Which operators can be used to perform calculations?
16
What is the output value of 'Average' in the provided pseudocode after the loop completes if the input marks are 15, 25 and 30?
17
What is the purpose of version control systems like Git?
پاسخ دهید(B)
To manage different versions of code and facilitate collaboration
18
Which type of loop guarantees that the code within the loop's body will always execute at least once?
19
Which of the following is a characteristic of a constant in a computer program?
پاسخ دهید(C)
Its value doesn't change during the program's execution.
20
In the pseudocode, what action does the statement `TOTAL = TOTAL + MARK` perform?
پاسخ دهید(B)
Adds the current mark to the total.
21
Which data type would be best suited for storing the value of PI (3.14159)?
22
What is the primary purpose of storing data in a file, as mentioned in the context of computer programming?
پاسخ دهید(B)
To permanently store data that will be required again.
23
What is the use of the `IF` statement in the pseudo-code examples?
پاسخ دهید(B)
To make a decision based on a condition.
24
Which of the following are characteristics of a good algorithm?
25
Which logical operator yields TRUE only if both operands are TRUE?
26
In the Totaling examples, what operation is performed by the statement: `TotalWeight = TotalWeight + Weight;`?
پاسخ دهید(A)
Adding weight to total weight.
27
In the Totaling example, how is the variable 'TotalWeight' updated?
پاسخ دهید(C)
TotalWeight = TotalWeight + Weight
28
Which data type is most appropriate for storing a whole number (integer) in most programming languages?
29
What is the primary difference between procedures and functions?
پاسخ دهید(A)
Functions always return a value, while procedures do not.
30
What does the 'x' mode do when you open a file?
پاسخ دهید(C)
Creates the file if it does not exist and opens it for writing.
31
Which of the following is an example of a library routine?
32
What is the purpose of the lines: `NumOfStudents = 5` and `NumOfSubjects = 4` in the provided pseudo-code?
پاسخ دهید(B)
To initialize the number of students and subjects.
33
If the condition in an IF statement is false, which part of the statement will be executed?
پاسخ دهید(C)
The ELSE block (if present).
34
Which of the following is considered a function that programmers use for comment in many languages?
35
What's the primary function of the `Uppercase` method in string manipulation?
پاسخ دهید(C)
To convert all characters to uppercase.
36
Which of the following are characteristics of a good identifier name?
37
What is typically the symbol for division in programming?
38
Which statement is true about the provided example of a Pre-condition loop?
پاسخ دهید(B)
The loop may not execute at all.
39
What data types are used in Python, based on the code provided?
40
What kind of loop structure begins by checking the condition *before* executing the code block?
41
In the given pseudocode, what action is repeatedly performed within the loop?
پاسخ دهید(B)
Adding a mark to the total.
42
In the context of programming, what is a 'variable'?
پاسخ دهید(B)
A named storage location for data that can change during program execution.
43
In pseudocode, which command is commonly used to take input from a user?
44
What is the purpose of a 'loop' in programming?
پاسخ دهید(A)
To repeat a block of code multiple times.
45
What does the `Lowercase` string method typically do?
پاسخ دهید(C)
Convert all characters in the string to lowercase.
46
What is the purpose of a 'function' in programming?
پاسخ دهید(B)
To create a reusable block of code that performs a specific task.
47
What type of loop is represented by this code structure?
```
DO
Statements
WHILE condition
```
48
What type of algorithm is demonstrated in the provided "Worked example"?
49
In the Java example provided, what object is used to write to a file?
50
Which type of loop is exemplified by this code:
```
WHILE condition DO
Statements
ENDWHILE
```