1.
In a flowchart, which basic operation is a rectangle used to represent?
Correct Answer
C. Process/Assignment
Explanation
A rectangle in a flowchart is used to represent a process or assignment. This means that the rectangle symbolizes a specific action or task that needs to be performed within the flowchart. It could involve calculations, data manipulation, or any other operation that needs to be executed. The rectangle shape is commonly used to visually indicate this step in the flowchart and helps in organizing and understanding the sequence of actions within the process.
2.
Which of the following is not a significant part of a simple problem?
Correct Answer
D. Solution
Explanation
The given options, Input, Processing, and Output, are all significant parts of a simple problem as they represent the steps involved in problem-solving. However, the solution is not a significant part of a simple problem because it refers to the end result or the resolution of the problem rather than a step in the problem-solving process.
3.
During problem decomposition, expected results are documented in the _____________ column in the defining diagram.
Correct Answer
C. Output
Explanation
During problem decomposition, expected results are documented in the "Output" column in the defining diagram. This is because problem decomposition involves breaking down a complex problem into smaller, more manageable parts. The "Output" column in the defining diagram represents the expected outcomes or results of each component or sub-problem. By documenting the expected results in this column, it helps to clarify the specific outputs that need to be achieved in order to solve the overall problem.
4.
Developing and representing algorithms are included in the _______ step in the problem solving process.
Correct Answer
B. Third
Explanation
Developing and representing algorithms are included in the third step of the problem-solving process. This step involves designing a plan or strategy to solve the problem, which includes breaking it down into smaller, more manageable parts and creating a step-by-step algorithm or set of instructions to follow. This step is crucial in problem-solving as it helps to organize thoughts and actions, making it easier to solve complex problems effectively.
5.
ALL of the following are true about variables and constants EXCEPT that _______
Correct Answer
D. They can be used interchangeably.
Explanation
Variables and constants have names called identifiers, their names refer to an area of memory, and their names are created by the programmer. However, variables and constants cannot be used interchangeably. Variables can be assigned different values throughout the program, while constants have fixed values that cannot be changed once assigned. Therefore, the statement "they can be used interchangeably" is not true for variables and constants.
6.
Which of the following is an incorrect variable name?
Correct Answer
A. 1stchoice
Explanation
The variable name "1stchoice" is incorrect because it starts with a number, which is not allowed in variable names. Variable names should begin with a letter or an underscore.
7.
A ________ is a named location in memory, the value of which remains fixed.
Correct Answer
A. Constant
Explanation
A constant is a named location in memory, the value of which remains fixed. Unlike variables, the value of a constant cannot be changed once it is assigned. Constants are often used to store values that are not meant to be modified throughout the program, such as mathematical constants or configuration settings.
8.
Which data type is MOST appropriate for storing a value representing the weight of a new born child?
Correct Answer
C. Real
Explanation
The data type "Real" is the most appropriate for storing the weight of a newborn child because it allows for decimal values. The weight of a newborn can vary and may include fractions, so using a real data type allows for more accurate representation of the weight.
9.
What is the output of the following algorithms, if a is 5 and b is 9?
Read a, b
a= a+b
b= a/2
Print a, b
Correct Answer
B. 14, 7
Explanation
The algorithm starts by reading the values of a and b, which are given as 5 and 9 respectively. Then, it performs the operation a = a+b, which means a becomes 5+9=14. Next, it calculates b as a/2, which is 14/2=7. Finally, it prints the values of a and b, which are 14 and 7 respectively.
10.
Which condition will determine if n is of a higher value than 10?
Correct Answer
B. N > 10
Explanation
The condition "n > 10" will determine if n is of a higher value than 10. This condition checks if n is strictly greater than 10, meaning it only returns true if n is a value greater than 10. If n is equal to or less than 10, the condition will return false.
11.
Consider the following: Five numbers are to be input (under the control of a loop). The biggest number must be determined and output. How many columns are necessary for the required trace table?
Correct Answer
C. 3
Explanation
The trace table is used to keep track of the values of variables during the execution of a program. In this case, the program is inputting five numbers and determining the biggest number. Since there are five numbers, there will be five rows in the trace table to record the values of the numbers. However, the question is asking for the number of columns necessary for the trace table. The trace table typically includes columns for each variable or value being tracked. In this case, since only the biggest number needs to be determined and output, there is only one variable being tracked. Therefore, only one column is necessary for the required trace table.
12.
The number of ________ in an algorithm determines the number of rows in a trace table.
Correct Answer
B. Calculations
Explanation
The number of calculations in an algorithm determines the number of rows in a trace table. A trace table is used to track the values of variables and the flow of execution in an algorithm. Each calculation in the algorithm will result in a new row being added to the trace table, showing the updated values of the variables at each step. Therefore, the more calculations there are in an algorithm, the more rows will be needed in the trace table to fully trace the execution.
13.
Pseudocode is a __________ representation of algorithms
Correct Answer
B. Textual
Explanation
Pseudocode is a textual representation of algorithms because it uses a combination of natural language and programming language-like syntax to describe the steps and logic of an algorithm. It is not graphical because it does not use visual elements or diagrams to represent the algorithm. It is not verbal because it is not spoken or communicated orally.
14.
Which statement is used to determine if the value of x is the same or less than the value of y?
Correct Answer
B. If x
Explanation
The statement "if x < y" is used to determine if the value of x is the same or less than the value of y. This statement checks if x is strictly less than y, and if it is true, it executes the code inside the if block. If x is not less than y, the code inside the if block is not executed.
15.
A _________ is a named location in memory, the value of which changes during program execution.
Correct Answer
D. Variable
Explanation
A variable is a named location in memory that holds a value, and this value can be changed during the execution of a program. Unlike constants and literals, which have fixed values that do not change, variables allow for dynamic data storage and manipulation. Therefore, a variable is the correct answer as it accurately describes a named location in memory that can be modified during program execution.
16.
An algorithm specifies the flow of control from one ________ to another.
Correct Answer
C. Process
Explanation
An algorithm specifies the flow of control from one process to another. Algorithms are step-by-step instructions or procedures that outline how to solve a problem or accomplish a task. They define the logical sequence of actions that need to be performed, allowing the program to transition from one process to another in an organized manner. Therefore, the correct answer is "Process."
17.
Which algorithm will accept, add and then calculate and output the mean of TWO numbers?
Correct Answer
C. Read n1, n2
sum = n1 + n2
avg = sum/2
write avg
Explanation
The correct answer is "read n1, n2; sum = n1 + n2; avg = sum/2; write avg" because it correctly follows the steps to accept two numbers, calculate their sum, calculate the average, and then output the average. The other options either do not calculate the average correctly or do not include all the necessary steps.
18.
In flowcharting, which basic operation is a diamond used to represent?
Correct Answer
A. Decision
Explanation
A diamond is used to represent a decision in flowcharting. This means that at that point in the flowchart, a decision needs to be made based on a certain condition or criteria. The flow of the chart will then branch off into different paths depending on the outcome of the decision. The diamond shape is commonly used to visually represent this branching point in flowcharts.
19.
Which statement is used to determine and output the bigger of two unequal numbers?
Correct Answer
D. IF n1 > n2 THEN
print n1
ELSE print n2
Explanation
The given statement is used to determine and output the bigger of two unequal numbers. It first checks if n1 is greater than n2. If it is true, then it prints n1. If it is false, it prints n2. This ensures that the bigger number is always outputted.
20.
Which of the following descriptions are characteristics of an algorithm?
i. Precise
ii. Ambiguous
iii. Terminable
iv. Unambiguous
Correct Answer
D. I, iii and iv
Explanation
The characteristics of an algorithm include being precise, terminable, and unambiguous. A precise algorithm provides clear and specific instructions, leaving no room for interpretation. A terminable algorithm is one that will eventually reach a stopping point or termination. An unambiguous algorithm is one that has a single interpretation and is free from any ambiguity or confusion. Therefore, the correct answer is i, iii, and iv.
21.
State the correct DATA TYPE for the example provided.
45
Correct Answer
Integer
Explanation
The correct data type for the example provided is integer. This is because the number 45 is a whole number without any decimal places, which is characteristic of integers. Integers are used to represent whole numbers in computer programming and can be positive, negative, or zero.
22.
State the correct DATA TYPE for the example provided.
3.14
Correct Answer
Real
Explanation
The correct data type for the example provided is "Real". This is because 3.14 is a decimal number and the Real data type is used to represent decimal numbers in programming. Real data type is also known as float or double, depending on the programming language.
23.
State the correct DATA TYPE for the example provided.
A
Correct Answer
Character
Explanation
The correct data type for the example provided is "Character". This is because the example specifically mentions "A" as the data, which is a single character. In programming, a character data type is used to represent individual characters, such as letters, numbers, or symbols.
24.
State the correct DATA TYPE for the example provided.
Maria
Correct Answer
String
Explanation
The correct data type for the example provided, "Maria," is a string. This is because "Maria" is a sequence of characters, which is the definition of a string data type. Strings are used to store and manipulate text in programming languages.
25.
State the correct DATA TYPE for the example provided.
Cloudy = true
Sunny = false
Correct Answer
Boolean
Explanation
The correct data type for the example provided is Boolean. In programming, Boolean is a data type that can have two possible values: true or false. In this case, the variables Cloudy and Sunny are assigned the values true and false respectively, indicating the weather conditions.