1.
What will the following code produce? PRINT "Afrikom Computer School"
Correct Answer
B. A screen printed with Afrikom Computer School
Explanation
The code will produce a screen printed with "Afrikom Computer School" because the PRINT statement is typically used to display output on the screen.
2.
If the English language follows formats and rules on grammar, what does QBasic follow as a counterpart?
Correct Answer
B. Syntax
Explanation
QBasic follows syntax as its counterpart. Syntax refers to the set of rules and formats that need to be followed in a programming language to write correct and meaningful code. Just like English language follows grammar rules, QBasic follows syntax rules to ensure that the code is structured correctly and can be understood by the computer. Therefore, syntax is the correct answer in this context.
3.
"Name$" is known as a
Correct Answer
C. Variable
Explanation
In QBasic, variable names can be followed by a suffix to denote their data type. In this case, "Name$" indicates a variable named "Name" that is of type string. The "$" symbol is used to specify that the variable will store string data. Therefore, "Name$" is a string variable in QBasic.
4.
Text that you wish to appear on the screen while your program runs must appear inside of ---------------------
Correct Answer
C. Quotes
Explanation
The correct answer is "quotes" because when writing code, text that is meant to appear on the screen while the program runs is typically enclosed within quotation marks. This is a common convention in many programming languages. The use of slashes, brackets, or braces is not typically used for this purpose in programming.
5.
What must you do if a "Syntax Error" appears?
Correct Answer
A. Check for flaws, edit, and rerun. It may be a programmer's error.
Explanation
If "Syntax Error" appears, it means that there is a mistake in the code that does not conform to the programming language's syntax rules. To resolve this issue, the programmer should check for any flaws or mistakes in the code, make the necessary edits to fix the syntax error, and then rerun the program to see if the error is resolved. It is important to note that a syntax error is typically a mistake made by the programmer while writing the code, so they need to review and correct their own errors.
6.
A computer program is simply:
Correct Answer
B. A set of instructions to tell a computer how to perform a particular task
Explanation
The correct answer is "A set of instructions to tell a computer how to perform a particular task." A computer program is a collection of instructions that are written in a specific programming language to guide a computer in executing a specific task or set of tasks. These instructions can include algorithms, functions, and logical statements that direct the computer's operations and manipulate data. The purpose of a computer program is to solve problems or automate processes by providing step-by-step instructions to the computer.
7.
An algorithm is:
Correct Answer
C. A finite sequence (or series) of precise instructions for solving a problem.
Explanation
The correct answer is "A finite sequence (or series) of precise instructions for solving a problem." This is because an algorithm is a step-by-step procedure or set of rules that defines how to solve a specific problem or perform a specific task. It is a systematic approach that provides a clear and unambiguous set of instructions to solve a problem. The other options, such as the output of the instruction or the required data, are not accurate definitions of an algorithm.
8.
The following symbols are used in flowcharting, except:
Correct Answer
D. The cross symbol
Explanation
The cross symbol is not used in flowcharting. Flowcharts typically use symbols such as the terminal symbol to represent the start and end points of a process, the process symbol to represent a specific action or task, and the input/output symbol to represent the input or output of data. However, the cross symbol does not have a standard meaning or usage in flowcharting and is therefore not included as a symbol.
9.
The following are types of errors in programming, except:
Correct Answer
A. Grammar error
Explanation
The given question is about the types of errors in programming, and the correct answer is "Grammar error." In programming, a grammar error refers to a mistake in the syntax or structure of the code, which violates the rules of the programming language. Syntax error, logic error, and compile error are all types of errors commonly encountered in programming. A syntax error occurs when the code does not follow the correct syntax of the programming language. Logic error refers to a mistake in the program's algorithm or logic, leading to incorrect output. Compile error occurs during the compilation process when the code cannot be translated into machine language.
10.
What will be the output of the following code?
10 REM EXAMPLE OF HOW A COMMA
20 REM AFFECTS THE OUTPUT
30 REM PRINT STATEMENT
40 PRINT “4 + 7 = ”,
50 PRINT 4 + 7
60 PRINT END
Correct Answer
B. 4 + 7 = 11
Explanation
The code is using the PRINT statement to display the result of the expression "4 + 7". The comma after the first PRINT statement is used to separate the output. As a result, the output will be displayed on the same line. The first line will display "4 + 7 =", and the second line will display the result of the expression, which is "11". Therefore, the correct answer is "4 + 7 = 11".
11.
The CLS statement:
Correct Answer
C. Is used for clearing the screen.
Explanation
The CLS statement is used for clearing the screen. This statement is commonly used in programming languages to clear the output screen or console window. It helps to remove any existing text or data from the screen, providing a clean and empty display for new information to be presented. By using the CLS statement, the screen can be refreshed and made ready to display new data or messages to the user.
12.
BASIC is a typical example of an interpreted language.
Correct Answer
A. True
Explanation
BASIC is considered a typical example of an interpreted language because it is designed to be executed line by line, without the need for compilation. Interpreted languages like BASIC convert the source code into machine code at runtime, which allows for easier debugging and faster development. This is in contrast to compiled languages, which require the source code to be compiled into machine code before it can be executed. Therefore, it is accurate to say that BASIC is a typical example of an interpreted language.
13.
What is the acronym for BASIC?
Correct Answer
C. Beginner's All-Purpose Symbolic Instruction Code
Explanation
The correct answer is Beginner's All-Purpose Symbolic Instruction Code. BASIC is an acronym that stands for Beginner's All-Purpose Symbolic Instruction Code. It is a high-level programming language that was designed to be easy to learn and use for beginners. It was widely used in the 1960s and 1970s and played a significant role in the early development of personal computers.
14.
The following arithmetic operations are carried out in BASIC except
Correct Answer
D. X
Explanation
In BASIC, the caret (^) is used for exponentiation, the asterisk (*) is used for multiplication, and the plus (+) is used for addition. However, the "x" symbol is not a valid arithmetic operator in BASIC. Therefore, the correct answer is "x" because it is not a valid arithmetic operation in BASIC.
15.
This expression (a+b) 3 (raise to power 3) can be written in BASIC as follows:
Correct Answer
C. Both as in A and B
Explanation
The correct answer is "Both as in A and B." This is because both options A and B represent the expression (a+b) raised to the power of 3. Option A, (a+b)^3, uses the exponentiation operator to indicate raising to the power of 3. Option B, (a+b)*(a+b)*(a+b), represents the expression as the product of three identical terms, each being (a+b). Therefore, both options A and B are valid representations of the expression (a+b) 3 in BASIC.