1.
101. Programs written in an assembly language require a(n) ____, which also is a program, to convert the assembly
Correct Answer
B. Assembler
Explanation
Programs written in an assembly language require an assembler, which is a program that converts the assembly code into machine code. The assembler translates the mnemonic instructions and symbolic labels into binary instructions and memory addresses that the computer can understand and execute. Unlike a compiler, which translates high-level languages into machine code, an assembler specifically works with assembly language. An interpreter, on the other hand, executes the source code directly without converting it into machine code. A linker, while important in the overall process of program execution, is not responsible for converting assembly code into machine code.
2.
102. The repetition structure is also referred to as a loop or as ____.
Correct Answer
B. Iteration
Explanation
The repetition structure is also referred to as a loop or as iteration. This is because in programming, a repetition structure allows a certain set of instructions to be repeated multiple times until a specific condition is met. The term "iteration" is commonly used to describe this process of repeating a set of instructions. Therefore, "iteration" is the correct answer as it is another commonly used term to refer to the repetition structure or loop in programming.
3.
103. Some high-level languages use a(n) ____ rather than a(n) ____.
Correct Answer
A. Interpreter, compiler
Explanation
High-level languages use an interpreter rather than a compiler. An interpreter translates and executes the code line by line, converting it into machine code on the fly. This allows for immediate feedback and easier debugging. On the other hand, a compiler translates the entire code into machine code before execution, resulting in faster execution but a longer development cycle.
4.
104. The Windows environment typically uses ____ such as check boxes, list boxes, and buttons.
Correct Answer
B. Objects
Explanation
In the Windows environment, various graphical elements such as check boxes, list boxes, and buttons are commonly used. These elements are referred to as objects because they are distinct entities that can be interacted with by the user. Unlike registers, which are low-level storage locations in the computer's hardware, or procedures, which are sequences of instructions, objects in the Windows environment provide a visual interface for users to interact with the system. Mnemonics, on the other hand, are memory aids or shortcuts used to remember information, and are not directly related to the graphical elements in the Windows environment.
5.
105. The translation of an algorithm into a language that the computer can understand is referred to as ____ the algorithm.
Correct Answer
B. Coding
Explanation
The translation of an algorithm into a language that the computer can understand is referred to as coding. Coding involves writing the algorithm in a specific programming language, using the syntax and rules of that language, so that the computer can execute the instructions and perform the desired tasks.
6.
106. A coded algorithm is called a ____.
Correct Answer
D. Diagram
Explanation
A coded algorithm is not typically referred to as a pseudocode, library, or program. Instead, it is more commonly known as a diagram, which visually represents the steps and logic of an algorithm. This diagram helps in understanding and implementing the algorithm in a structured and organized manner.
7.
107. A programmer ____ a program by running it on the computer, using sample data to test the program’s accuracy.
Correct Answer
A. Evaluates
Explanation
A programmer evaluates a program by running it on the computer and using sample data to test its accuracy. This involves analyzing the program's performance, checking for any errors or bugs, and ensuring that it produces the desired results. By evaluating the program in this way, the programmer can make necessary adjustments and improvements to enhance its functionality and efficiency.
8.
108. The purpose of analyzing a problem is to determine the goal of solving the problem and the items that are needed to
Correct Answer
A. Output
Explanation
The purpose of analyzing a problem is to determine the goal of solving the problem and the items that are needed to achieve that goal. In this context, the term "output" refers to the desired result or outcome of solving the problem. By analyzing the problem, one can identify what needs to be produced or achieved as a result of the problem-solving process. Therefore, "output" is the correct answer as it aligns with the goal of determining the desired outcome of solving the problem.
9.
109. Some programmers use a(n) ____ to organize and summarize the results of a problem analysis.
Correct Answer
B. IPO chart
Explanation
An IPO chart, also known as an Input-Process-Output chart, is a tool used by programmers to organize and summarize the results of a problem analysis. It helps in identifying the inputs, processes, and outputs of a problem, allowing programmers to visualize the flow of data and information within a program. It is a systematic way of understanding and documenting the requirements of a problem, making it easier to design and develop a solution.
10.
110. In a flowchart, the oval symbol is called the ____ symbol.
Correct Answer
D. Start/stop
Explanation
The oval symbol in a flowchart is called the start/stop symbol. This symbol represents the beginning or end of the flowchart and indicates where the process starts or stops. It is commonly used to show the initiation or termination of a program or process.
11.
111. In a flowchart, the parallelogram symbol is called the ____ symbol.
Explanation
In a flowchart, the parallelogram symbol is called the "input/output" symbol. This symbol represents any input or output operation in the flowchart, such as reading data from a user or displaying information to the user. It is used to indicate the points in the flowchart where data is either entered into the system or displayed to the user.
12.
112. ____ is called the insertion operator.
Correct Answer
C.
Explanation
The insertion operator in programming is denoted by the double greater than symbol (>>). It is used to insert data into an output stream, such as displaying values on the console or writing to a file. This operator is commonly used in C++ to concatenate or display multiple variables or values in a single output statement.
13.
113. ____ is called the extraction operator.
Correct Answer
D. >>
Explanation
The extraction operator ">>" is used in C++ to extract data from an input stream, such as reading values from the console or a file. It is called the extraction operator because it extracts the data from the stream and stores it in a variable.
14.
114. ____ refers to the process of locating and removing any errors in a program.
Correct Answer
A. Debugging
Explanation
Debugging refers to the process of locating and removing any errors in a program. It involves identifying and fixing the bugs or issues that may cause the program to not function correctly. This process is essential in ensuring the program's functionality and reliability. Testing, linking, and compiling are all important steps in the software development process, but they do not specifically focus on locating and removing errors in a program like debugging does.
15.
115. ____ is an example of a syntax error.
Correct Answer
A. Cout
Explanation
The line "cout" is an example of a syntax error because it is missing the "
16.
116. When you compile a Microsoft Visual C++ 2005 program, the compiler generates the appropriate object code, saving it automatically in a file whose filename extension is ____.
Correct Answer
A. .obj
Explanation
When you compile a Microsoft Visual C++ 2005 program, the compiler generates the appropriate object code, saving it automatically in a file whose filename extension is .obj.
17.
117. A #include ____ provides a convenient way to merge the source code from one file with the source code in another file, without having to retype the code.
Explanation
A #include directive provides a convenient way to merge the source code from one file with the source code in another file, without having to retype the code. This allows for code reuse and modularity, as it allows the programmer to include commonly used code or libraries in multiple files without duplicating the code. The included file is typically a header file (.h) that contains function prototypes, constant definitions, and other declarations that are needed in the source file.
18.
118. Variables and ____ are locations (within the computer’s internal memory) where a program can temporarily store data while the program is running.
Correct Answer
D. Named constants
Explanation
Named constants are locations within the computer's internal memory where a program can temporarily store data while the program is running. Unlike variables, named constants cannot be changed once they are assigned a value. They are used to store data that remains constant throughout the execution of the program, such as mathematical or physical constants. This allows for easier readability and maintenance of the code, as the value of the constant can be easily identified and modified if necessary.
19.
119. Examples of ____ in the C++ programming language include int, double, and return.
Correct Answer
A. Keywords
Explanation
In the C++ programming language, keywords are reserved words that have a specific meaning and cannot be used as identifiers. Examples of keywords in C++ include int, double, and return. These keywords are used to define data types (int, double), control the flow of a program (return), and perform various other functions. They are an essential part of the language and must be used correctly to ensure proper program execution.
20.
120. ____ is a character literal constant.
Correct Answer
C. ‘x’
Explanation
A character literal constant is a single character enclosed within single quotation marks. In this case, the correct answer is ‘x’ because it is the only option that follows this format. The other options, X, "x", and $x, do not meet the criteria of being enclosed within single quotation marks.
21.
121. ____ is a string literal constant.
Correct Answer
B. ""
Explanation
The empty string "" is a string literal constant. It represents a string that contains no characters.
22.
122. When a program instructs the computer to assign a value to a memory location, if the value’s data type does not match the memory location’s data type, the computer uses a process called ____ to convert the value to fit the memory location.
Correct Answer
A. Implicit type conversion
Explanation
When a program instructs the computer to assign a value to a memory location, if the value's data type does not match the memory location's data type, the computer uses a process called implicit type conversion to convert the value to fit the memory location. This means that the computer automatically converts the value to the appropriate data type without the need for any explicit conversion or casting.
23.
123. After executing the following lines of code, the result will be ____.int average = 0;double test1 = 90.0;double test2 = 81.0;average = (test1 + test2) / 2;
Correct Answer
A. 85 assigned to average
Explanation
The given code calculates the average of test1 and test2 by summing them and dividing by 2. Since test1 is 90.0 and test2 is 81.0, the sum is 171.0. Dividing 171.0 by 2 gives us 85.0. However, the variable average is an integer type, so it can only store whole numbers. Therefore, the decimal part of 85.0 is truncated, and the final value assigned to average is 85.
24.
124. The ____ statement tells the computer to convert the double number 3.1 to float, and then assign the result to a float variable named price.
Correct Answer
B. Float price = static_cast3.1;
Explanation
The correct answer is "float price = static_cast(3.1);" because the static_cast keyword is used to explicitly convert the double number 3.1 to a float data type. The syntax for static_cast is static_cast(expression), where new_type is the desired data type and expression is the value to be converted. In this case, the expression is 3.1 and the new_type is float, so the double value 3.1 is converted to a float and assigned to the variable named price.
25.
125. The statement ____ creates a string variable named company and initializes it to the empty string.
Correct Answer
C. String company = "";
Explanation
The correct answer is "string company = "";". This statement creates a string variable named company and initializes it to an empty string. The double quotation marks represent an empty string in programming.
26.
126. The ____ function can be used to get string input from the user at the keyboard.
Correct Answer
A. Getline( )
Explanation
The getline() function can be used to get string input from the user at the keyboard.
27.
127. To use the fixed stream manipulator, the program must contain the ____ statement.
Correct Answer
B. Using std::fixed;
Explanation
To use the fixed stream manipulator, the program must contain the "using std::fixed;" statement. This statement is necessary to include the fixed manipulator from the standard library, which allows for the formatting of floating-point values in fixed-point notation. The "using" keyword is used to bring the fixed manipulator into the current scope, so it can be used in the program to format the output of floating-point values.
28.
128. A(n) ____ selection structure contains only one set of instructions, which are processed when the condition is true.
Correct Answer
A. If
Explanation
An "if" selection structure contains only one set of instructions that are executed when the condition is true. This means that if the condition specified in the "if" statement evaluates to true, the instructions within the "if" block will be executed. In contrast, an "if/else" structure allows for two sets of instructions, one for when the condition is true and another for when it is false. The "switch" and "case" keywords are used for implementing multi-way selection structures, where different sets of instructions are executed based on the value of a variable.
29.
129. The ____ in a flowchart is called the selection/repetition symbol.
Correct Answer
B. Diamond
Explanation
The diamond symbol in a flowchart is used to represent the selection/repetition structure. This structure is used to make decisions or repeat a set of instructions based on certain conditions. The diamond symbol typically contains a question or a condition that determines the flow of the program. Therefore, the correct answer is diamond.
30.
130. In a flowchart, there is/are ____ flowline(s) leading out of the selection/repetition symbol.
Correct Answer
B. Two
Explanation
In a flowchart, there are two flowlines leading out of the selection/repetition symbol. This symbol is used to represent a decision point where the flow of the program can branch out into two different paths based on a condition. The two flowlines represent the two possible outcomes or paths that the program can take after the decision is made.
31.
131. Comparison operators are often referred to as ____ operators.
Correct Answer
C. Relational
Explanation
Comparison operators are often referred to as "relational" operators because they are used to compare two values and determine the relationship between them. These operators include greater than, less than, equal to, not equal to, greater than or equal to, and less than or equal to. They return a boolean value (true or false) based on the result of the comparison.
32.
132. You can use ____ to override the order of precedence of comparison operators.
Correct Answer
D. ()
Explanation
Parentheses () can be used to override the order of precedence of comparison operators. By using parentheses, we can group certain comparisons together and ensure that they are evaluated before others. This allows us to control the order in which the comparisons are performed and can be useful when we want to prioritize certain comparisons over others.
33.
133. You use ____ to test for equality in C++.
Correct Answer
B. ==
Explanation
In C++, the == operator is used to test for equality. This operator compares two values and returns true if they are equal, and false otherwise. It is commonly used in conditional statements and loops to check if two values are equal. The = operator, on the other hand, is used for assignment, not equality testing. The := and != operators are not valid operators in C++.
34.
134. When the ____ logical operator is used to create a compound condition, all of the conditions must be true for the compound condition to be true.
Correct Answer
A. And
Explanation
When the "And" logical operator is used to create a compound condition, it requires all of the conditions to be true in order for the compound condition to be true. This means that if any of the conditions within the compound condition are false, the entire compound condition will be false.
35.
135. The And operator in C++ is ____.
Correct Answer
C. &&
Explanation
The correct answer is &&. In C++, the && operator is the logical AND operator. It is used to combine two conditions and returns true only if both conditions are true.
36.
136. The Or operator in C++ is ____.
Explanation
The Or operator in C++ is used to combine two conditions and returns true if either one of the conditions is true. It is represented by the symbol "||" and is commonly used in conditional statements and loops to create complex logical expressions.
37.
137. The ____ operator has a higher precedence than the <= operator.
Correct Answer
A. +
Explanation
The + operator has a higher precedence than the
38.
138. In C++, you can use the ____ function to convert a character to uppercase.
Correct Answer
A. Toupper( )
Explanation
In C++, the toupper() function is used to convert a character to uppercase. This function takes a single character as input and returns the uppercase version of that character. It is a built-in function in the C++ standard library and is commonly used when working with characters and strings in C++. The other options, toUpper(), toUpperCase(), and upperCase() are not valid functions in C++, so the correct answer is toupper().
39.
139. You need to enter the ____ directive in any program that uses the transform() function.
Correct Answer
D. #include
Explanation
The correct answer is #include. This directive is used to include the necessary header file in the program that contains the definition of the transform() function. By including the appropriate header file, the program can access and use the transform() function without any compilation errors.
40.
140. You need to enter the ____ statement in any program that uses the transform() function.
Correct Answer
C. Using std::transform;
Explanation
In order to use the transform() function in a program, the statement "using std::transform;" needs to be entered. This statement allows the program to access the transform() function from the standard library.
41.
141. A(n) ____ is a set of step-by-step instructions that accomplish a task.Consider the following pseudocode:1. enter the code and sales amount2. calculate the bonus amount by multiplying the sales amount by .083. if (the code is X)if (the sales are greater than or equal to 10000)add 150 to the bonus amountelseadd 125 to the bonus amountend ifend if4. display the bonus amount
Correct Answer
A. Algorithm
Explanation
The given pseudocode represents a set of step-by-step instructions that accomplish a task. It outlines the process of entering the code and sales amount, calculating the bonus amount based on the sales amount, and displaying the bonus amount. Therefore, the correct answer is algorithm.
42.
142. If the code is X and the sales amount is 15000, the value of the bonus amount at the end of the algorithm will be ____.
43.
143. A common error made when writing selection structures is to use a ____ operator in the outer selection structure’s condition when a nested selection structure is needed.
Correct Answer
A. Logical
Explanation
When writing selection structures, it is important to use the correct operator in the condition. In this case, the correct operator to use is the logical operator. Using a logical operator allows for the evaluation of multiple conditions and the execution of different code blocks based on the result. Using a comparison, mathematical, or concatenation operator would not allow for the same level of control and flexibility in the selection structure.
44.
144. Multiple-path selection structures are also referred to as ____ selection structures.
Correct Answer
D. Extended
Explanation
Multiple-path selection structures are also referred to as "extended" selection structures. This term is used to describe selection structures that have multiple paths or branches, allowing for more complex decision-making processes. Unlike simple selection structures, which only have two possible paths, extended selection structures can have multiple paths and can handle more complex conditions and logic.
45.
145. The flowchart symbol for the switch form of the selection structure is the ____.
Correct Answer
C. Diamond
Explanation
The flowchart symbol for the switch form of the selection structure is the diamond. In a flowchart, the diamond shape represents a decision point where different paths can be taken based on the value of a specific variable or condition. The switch form of the selection structure allows for multiple conditions to be evaluated and different actions to be taken based on each condition. Therefore, the diamond symbol is used to indicate this decision-making process in the flowchart.
46.
146. In a flowchart, the switch symbol has ____ flowline(s) leading out of the symbol.
Correct Answer
D. Many
Explanation
The switch symbol in a flowchart can have multiple flowlines leading out of it, allowing for multiple possible paths or conditions in the flowchart. This allows for more complex decision-making and branching in the flowchart, making it a versatile symbol in representing different possibilities and outcomes.
47.
147. In C++, you use the ____ statement to code the switch form of the selection structure.
Correct Answer
D. Switch
Explanation
In C++, the switch statement is used to code the switch form of the selection structure. The switch statement allows you to compare the value of a variable against multiple cases and execute different blocks of code based on the matched case. It provides a more efficient way to handle multiple conditions compared to using multiple if/else statements. Therefore, the correct answer is "switch".
48.
148. In C++, the switch statement begins with the switch clause followed by an opening ____.
Correct Answer
B. {
Explanation
In C++, the switch statement begins with the switch clause followed by an opening curly brace. The opening curly brace is used to indicate the start of the block of code that will be executed based on the value of the expression in the switch clause.
49.
149. In the switch statement, when the selectorExpression does not match any of the values listed in the case clauses,the computer processes the instructions contained in the ____ clause or, if this clause is not available, it skips to the instruction following the switch statement’s closing brace.
Correct Answer
C. Default
Explanation
In a switch statement, when the selectorExpression does not match any of the values listed in the case clauses, the computer processes the instructions contained in the default clause. If the default clause is not available, the computer skips to the instruction following the switch statement’s closing brace.
50.
150. Pretest loops are also called ____ loops.
Correct Answer
A. Top-driven
Explanation
Pretest loops are also called "top-driven" loops because the condition is checked before the loop body is executed. In other words, the loop will only run if the condition is initially true. This type of loop is commonly used when the number of iterations is unknown or when the loop should not run if the condition is false from the beginning. The opposite of a top-driven loop is a bottom-driven loop, where the condition is checked after the loop body is executed.