Computer Science for IGCSE & O level - Programming (Section 7)

1
What is the key objective of program debugging?
Answer
(B)
To find and fix errors.
2
In the programming, which keyword can you use to specify the variable type?
Answer
(C)
All the above
3
What does an algorithm represent in the context of programming?
Answer
(B)
A series of steps to solve a problem.
4
What is string concatenation?
Answer
(C)
Combining two or more strings.
5
Which type of loop is represented by `WHILE...DO`?
Answer
(B)
Pre-condition loop.
6
What does the code "DECLARE SecondNum : REAL" indicate?
Answer
(B)
The variable SecondNum is declared as a real number.
7
Which of the following is NOT a type of loop discussed in the text?
Answer
(D)
Selection loop
8
What is the main goal of code debugging?
Answer
(C)
To find and fix errors (bugs) in the code.
9
If `NumberSubjects = 5` and a loop is designed to iterate through each subject, how many times will the loop run?
Answer
(B)
5
10
In programming, what is a 'loop' primarily used for?
Answer
(B)
Repeating a block of code multiple times.
11
What programming construct facilitates the repeated execution of a block of code?
Answer
(C)
Loop
12
What type of data would be best used for a ClassName variable?
Answer
(D)
STRING
13
Which concept is used to repeat the steps of a program?
Answer
(C)
Iteration
14
What defines the scope of a variable?
Answer
(C)
Where the variable can be accessed.
15
What is the result of `print(10 > 5 and 2 < 1)`?
Answer
(B)
False
16
Which of the following is typically used to store multiple values of the same type?
Answer
(C)
Array
17
What is the result of the following code segment: `x = 10; y = 3; z = x // y;`?
Answer
(A)
3
18
What does the acronym 'IDE' stand for?
Answer
(A)
Integrated Development Environment
19
When dealing with a two-dimensional array, what would be required in the declaration or initialization?
Answer
(B)
A row index and a column index
20
What is the benefit of modular programming?
Answer
(C)
It makes it easier to understand, test, and maintain code.
21
Which of the following is used for comments?
Answer
(D)
All of the above
22
What does the term 'algorithm' generally refer to in computer science?
Answer
(B)
A step-by-step procedure to solve a problem.
23
Which of the following best defines the concept of scope in programming?
Answer
(C)
The portion of the code where a variable is accessible.
24
Which of the following best describes the role of a FOR loop in array manipulation?
Answer
(C)
To populate or iterate through the array.
25
How are elements in an array typically accessed?
Answer
(B)
By their index or position.
26
What is the `ELSE` statement typically used for in combination with an `IF` statement?
Answer
(C)
To execute a block of code when the `IF` condition is false.
27
What is the keyword used within a function to return a value in the provided examples?
Answer
(B)
RETURN
28
What is the appropriate method to read a file in most modern languages?
Answer
(A)
read
29
What is the primary purpose of the provided pseudo-code snippet's 'FOR' loop in the context of calculating student marks?
Answer
(B)
To iterate through each student in a class.
30
What is a key advantage of using constants in programming?
Answer
(C)
Constants make the code more readable and maintainable.
31
What is the output of `print(str(123) + "456")`?
Answer
(B)
123456
32
Why is it important to use well-named identifiers?
Answer
(C)
To improve the code's readability.
33
Which of these concepts is NOT part of the basic program concepts?
Answer
(D)
loops
34
What is the output of "Hello".Substring(2, 2)?
Answer
(B)
ll
35
Which of the following best describes a "constant" in programming?
Answer
(B)
A value that does not change during program execution.
36
Which function can perform the 'Hello World' output in Java?
Answer
(A)
System.out.println()
37
Which of the following statements describes the main characteristic of a function in programming?
Answer
(B)
A function must always return a value.
38
Which characteristic distinguishes a function from a procedure?
Answer
(B)
Functions always return a value.
39
What does the term 'algorithm' primarily refer to?
Answer
(A)
A set of instructions for completing a task.
40
What is the purpose of writing and testing programs?
Answer
(C)
To find and fix any errors (bugs) in the code.
41
What does the term 'iteration' mean in programming?
Answer
(B)
Repeating a block of code.
42
Which of these best describes a parameter in the context of procedures and functions?
Answer
(C)
A variable that stores the values of the arguments passed to a procedure or function.
43
Which of the following is a purpose of the 'input' operation in a program?
Answer
(B)
To receive data from the user.
44
In pseudo-code what is an array?
Answer
(B)
A structured form of data type
45
What does an output statement do in a programming language?
Answer
(C)
Displays results to the user.
46
What is the purpose of the modulus operator (%)?
Answer
(B)
To find the remainder of a division.
47
What does the term 'Iteration' mean?
Answer
(A)
The action of repeating a set of statements
48
What is the role of an algorithm in the context of computer programming?
Answer
(C)
To solve a specific problem through a series of steps.
49
What do parameters do in a function or procedure?
Answer
(B)
They provide a way to pass data into the function or procedure.
50
What is the keyword used in Java to declare the variables?
Answer
(D)
None of the above