Computer Science for IGCSE & O level - Programming (Section 7)
1
What is the key objective of program debugging?
2
In the programming, which keyword can you use to specify the variable type?
3
What does an algorithm represent in the context of programming?
Απάντηση(B)
A series of steps to solve a problem.
4
What is string concatenation?
Απάντηση(C)
Combining two or more strings.
5
Which type of loop is represented by `WHILE...DO`?
6
What does the code "DECLARE SecondNum : REAL" indicate?
Απάντηση(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?
8
What is the main goal of code debugging?
Απάντηση(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?
10
In programming, what is a 'loop' primarily used for?
Απάντηση(B)
Repeating a block of code multiple times.
11
What programming construct facilitates the repeated execution of a block of code?
12
What type of data would be best used for a ClassName variable?
13
Which concept is used to repeat the steps of a program?
14
What defines the scope of a variable?
Απάντηση(C)
Where the variable can be accessed.
15
What is the result of `print(10 > 5 and 2 < 1)`?
16
Which of the following is typically used to store multiple values of the same type?
17
What is the result of the following code segment: `x = 10; y = 3; z = x // y;`?
18
What does the acronym 'IDE' stand for?
Απάντηση(A)
Integrated Development Environment
19
When dealing with a two-dimensional array, what would be required in the declaration or initialization?
Απάντηση(B)
A row index and a column index
20
What is the benefit of modular programming?
Απάντηση(C)
It makes it easier to understand, test, and maintain code.
21
Which of the following is used for comments?
22
What does the term 'algorithm' generally refer to in computer science?
Απάντηση(B)
A step-by-step procedure to solve a problem.
23
Which of the following best defines the concept of scope in programming?
Απάντηση(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?
Απάντηση(C)
To populate or iterate through the array.
25
How are elements in an array typically accessed?
Απάντηση(B)
By their index or position.
26
What is the `ELSE` statement typically used for in combination with an `IF` statement?
Απάντηση(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?
28
What is the appropriate method to read a file in most modern languages?
29
What is the primary purpose of the provided pseudo-code snippet's 'FOR' loop in the context of calculating student marks?
Απάντηση(B)
To iterate through each student in a class.
30
What is a key advantage of using constants in programming?
Απάντηση(C)
Constants make the code more readable and maintainable.
31
What is the output of `print(str(123) + "456")`?
32
Why is it important to use well-named identifiers?
Απάντηση(C)
To improve the code's readability.
33
Which of these concepts is NOT part of the basic program concepts?
34
What is the output of "Hello".Substring(2, 2)?
35
Which of the following best describes a "constant" in programming?
Απάντηση(B)
A value that does not change during program execution.
36
Which function can perform the 'Hello World' output in Java?
37
Which of the following statements describes the main characteristic of a function in programming?
Απάντηση(B)
A function must always return a value.
38
Which characteristic distinguishes a function from a procedure?
Απάντηση(B)
Functions always return a value.
39
What does the term 'algorithm' primarily refer to?
Απάντηση(A)
A set of instructions for completing a task.
40
What is the purpose of writing and testing programs?
Απάντηση(C)
To find and fix any errors (bugs) in the code.
41
What does the term 'iteration' mean in programming?
Απάντηση(B)
Repeating a block of code.
42
Which of these best describes a parameter in the context of procedures and functions?
Απάντηση(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?
Απάντηση(B)
To receive data from the user.
44
In pseudo-code what is an array?
Απάντηση(B)
A structured form of data type
45
What does an output statement do in a programming language?
Απάντηση(C)
Displays results to the user.
46
What is the purpose of the modulus operator (%)?
Απάντηση(B)
To find the remainder of a division.
47
What does the term 'Iteration' mean?
Απάντηση(A)
The action of repeating a set of statements
48
What is the role of an algorithm in the context of computer programming?
Απάντηση(C)
To solve a specific problem through a series of steps.
49
What do parameters do in a function or procedure?
Απάντηση(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?