1.
Algorithms have four very important attributes; what are they?
Correct Answer
B. Precise, Unambiguous, Finite, Logical Sequence
Explanation
Algorithms need to be precise in order to provide clear and specific instructions. They also need to be unambiguous, meaning that each step should have a single interpretation. Additionally, algorithms should be finite, meaning that they should eventually terminate. Finally, algorithms should follow a logical sequence, where each step logically follows from the previous one. These attributes ensure that algorithms are effective and reliable in solving problems.
2.
The design of any computer program involves two major phases; they are:
Correct Answer
C. Problem Solving and Program Implementation
Explanation
The correct answer is "Problem Solving and Program Implementation". This answer accurately reflects the two major phases involved in the design of any computer program. The first phase, problem solving, refers to understanding and defining the problem that the program aims to solve. This involves analyzing the problem, identifying requirements, and devising a solution strategy. The second phase, program implementation, involves translating the solution strategy into a programming language and compiling it into executable code. Together, these two phases encompass the essential steps in designing a computer program.
3.
A defining diagram comprises of three sections; they are:
Correct Answer
C. Input, Processing, Output
Explanation
A defining diagram typically consists of three sections: Input, Processing, and Output. These sections represent the fundamental steps in a program or system. Input refers to the data or information that is entered into the system, Processing involves manipulating or transforming the input data, and Output is the result or outcome of the processing that is displayed or produced. This three-step process is commonly used in programming and problem-solving to design and implement solutions. Therefore, the correct answer is Input, Processing, Output.
4.
Which is NOT true of a variable?
Correct Answer
A. Can be a minimum of 40 characters
Explanation
A variable can be a minimum of 40 characters, as there is no restriction on the length of a variable name in most programming languages. Variables can have spaces in their names, and they cannot start with a number. Therefore, the statement "Cannot have spaces" and "Cannot start with a number" are true, while "Can be a minimum of 40 characters" is false.
5.
A variable is:
Correct Answer
A. A small block of memory that stores a value
Explanation
A variable is a small block of memory that stores a value. This means that it is a location in the computer's memory where data can be stored and accessed. It is used to hold different values that can be manipulated and changed within a program. Unlike a constant, which has a fixed value that cannot be altered, a variable can be assigned different values throughout the execution of a program. Therefore, the correct answer is that a variable is a small block of memory that stores a value.
6.
A ___________ is an area of storage whose value never changes during processing?
Correct Answer
C. Constant
Explanation
A constant is an area of storage whose value never changes during processing. Unlike variables, which can be assigned different values throughout the program, constants have a fixed value that remains the same. This makes them useful for storing values that should not be modified, such as mathematical constants or fixed values used in calculations.
7.
Which of the following is an algorithm whereby a segment of the code is repeated based on a condition?
Correct Answer
C. Loop
Explanation
A loop is an algorithm that allows a segment of code to be repeated based on a condition. It allows for the efficient execution of repetitive tasks by executing a block of code multiple times until a specific condition is met. This helps in automating processes and reducing manual effort. Loops are widely used in programming to iterate through data structures, perform calculations, and implement various control structures.
8.
Within the following segment of a pseudocode algorithm, which line number represents the Assignment Statement? 1. READ num1, num2, num32. LET Total = num1+num2+num33. PRINT Total
Correct Answer
B. 2
Explanation
Line number 2 represents the Assignment Statement because it assigns the sum of num1 and num2 to the variable Total using the "=" operator.
9.
Which of the following is used within a flowchart to represent a decision point?
Correct Answer
C. Diamond
Explanation
A diamond is used within a flowchart to represent a decision point. In a flowchart, a decision point is where the flow splits into two or more paths based on a condition or a decision that needs to be made. The diamond shape is used to indicate this decision point, and the flowchart will have arrows leading from the diamond to the different paths based on the outcomes of the decision.
10.
The following is the syntax for which algorithm?Input Let = Print ,
Correct Answer
A. Simple
Explanation
The syntax mentioned in the question is for the Simple algorithm.
11.
An assembler is used to convert which generation of computer language back to machine code?
Correct Answer
B. Second Generation
Explanation
An assembler is a software tool used to convert assembly language, which is the second-generation computer language, back to machine code. Assembly language is a low-level programming language that is specific to a particular computer architecture and is easier for humans to understand and write compared to machine code. Assemblers are commonly used in second-generation computers to translate assembly language instructions into machine code that can be executed by the computer's processor.
12.
PASCAL is an example of what TYPE of programming language?
Correct Answer
C. Structured Language
Explanation
PASCAL is considered a structured programming language. It was designed to promote structured programming practices, which emphasize the use of control structures like loops and conditionals to improve code readability and maintainability. Structured programming languages aim to reduce complexity and increase the efficiency of software development by breaking down programs into smaller, more manageable modules. PASCAL's syntax and features align with the principles of structured programming, making it a suitable example of this type of language.
13.
The Computer Language that uses binary is:
Correct Answer
C. Machine Language
Explanation
Machine language is the correct answer because it is the language that directly communicates with the computer's hardware using binary code. It consists of instructions and data represented in binary form, which the computer can understand and execute. Other computer languages like assembler language and assembly language are higher-level languages that are eventually translated into machine language for the computer to execute. Therefore, machine language is the only language that uses binary directly.
14.
The program that translates high level programs into machine code is known as:
Correct Answer
A. Complier
Explanation
A compiler is a program that translates high-level programming languages into machine code that can be understood and executed by a computer. It takes the entire program as input and generates an executable file or object code as output. This process involves lexical analysis, syntax analysis, semantic analysis, code optimization, and code generation. An assembler, on the other hand, translates assembly language code into machine code. Pascal is a high-level programming language, not a program that translates programs. Therefore, the correct answer is Compiler.
15.
An example of a dry run is:
Correct Answer
C. Pseudocode
Explanation
The given question is asking for an example of a dry run. A dry run is a method of testing or simulating a process or algorithm without actually executing it. Among the options provided, "Pseudocode" is the most suitable answer as it is a method of writing out an algorithm using a combination of natural language and programming code-like syntax. Pseudocode allows for a step-by-step representation of the algorithm without being tied to any specific programming language. Therefore, it can be used effectively for dry runs and understanding the logic of an algorithm before implementing it in a specific programming language.