C Plus Plus - From 101 To 222 Multiple Choice

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Mrmirante
M
Mrmirante
Community Contributor
Quizzes Created: 2 | Total Attempts: 4,315
| Attempts: 658 | Questions: 122
Please wait...
Question 1 / 122
0 %
0/100
Score 0/100
1. 177. The ____ store the information passed to the function when the function is invoked.

Explanation

Formal parameters are variables defined in the function declaration and are used to store the information passed to the function when it is invoked. They act as placeholders for the actual values that will be passed as arguments. In this case, the correct answer is "formal parameters" because they are the variables that store the information passed to the function.

Submit
Please wait...
About This Quiz
C Plus Plus - From 101 To 222 Multiple Choice - Quiz

Are you an aspiring programmer and have just started learning C++ language? The quiz below is perfect for you and is from 101 to 222 and is a multiple-choice quiz to help you understand it better. All the best and keep an eye out for some more C++ quizzes. All... see morethe best. see less

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. 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.

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.

Submit
3. 130. In a flowchart, there is/are ____ flowline(s) leading out of the selection/repetition symbol.

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.

Submit
4. 102. The repetition structure is also referred to as a loop or as ____.

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.

Submit
5. 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 amount
2. calculate the bonus amount by multiplying the sales amount by .08
3. if (the code is X)
if (the sales are greater than or equal to 10000)
add 150 to the bonus amount
else
add 125 to the bonus amount
end if
end if
4. display the bonus amount

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.

Submit
6. 175. The modulus arithmetic operator (____) divides two integers and results in the remainder of the division.

Explanation

The modulus arithmetic operator (%) divides two integers and gives the remainder of the division. For example, if we divide 10 by 3 using the modulus operator (%), the result is 1, because 10 divided by 3 equals 3 with a remainder of 1. Therefore, the correct answer is %.

Submit
7. 222. When two or more methods have the same name but different parameterLists, the methods are referred to as ____ methods.

Explanation

When two or more methods have the same name but different parameter lists, they are referred to as overloaded methods. Overloading allows multiple methods to have the same name but different parameters, allowing for more flexibility and versatility in programming. This allows developers to create methods that perform similar tasks but with different inputs, improving code readability and organization.

Submit
8. 145. The flowchart symbol for the switch form of the selection structure is the ____.

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.

Submit
9. 114. ____ refers to the process of locating and removing any errors in a program.

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.

Submit
10. 176. To use the time() function in a program, the program must contain the ____ directive.

Explanation

To use the time() function in a program, the program must contain the "time.h" directive. This directive includes the necessary header file that contains the declaration of the time() function. The time() function is used to retrieve the current calendar time in seconds since the Unix epoch. By including the "time.h" directive, the program can access and utilize the time() function for time-related operations.

Submit
11. 110. In a flowchart, the oval symbol is called the ____ symbol.

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.

Submit
12. 133. You use ____ to test for equality in C++.

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++.

Submit
13. 135. The And operator in C++ is ____.

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.

Submit
14. 148. In C++, the switch statement begins with the switch clause followed by an opening ____.

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.

Submit
15. 113. ____ is called the extraction operator.

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.

Submit
16. 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;

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.

Submit
17. 168. In the code shown above, the ____ variable is used as a counter.

Explanation

In the given code, the "region" variable is used as a counter. It is likely that the code is counting the number of sales or transactions that occur within a specific region. The other variables mentioned, such as "sales", "totRegSales", and "cout", do not necessarily indicate that they are being used as counters in this context.

Submit
18. 190. When the computer processes the return 0; statement in the main() function, it returns the number 0 to the ____ to indicate that the program ended normally.

Explanation

When the computer processes the return 0; statement in the main() function, it returns the number 0 to the operating system to indicate that the program ended normally. The operating system uses the return value to determine the status of the program execution. A return value of 0 typically signifies successful execution, while non-zero values may indicate errors or abnormal termination.

Submit
19. 129. The ____ in a flowchart is called the selection/repetition symbol.

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.

Submit
20. 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.

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.

Submit
21. 104. The Windows environment typically uses ____ such as check boxes, list boxes, and buttons.

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.

Submit
22. 132. You can use ____ to override the order of precedence of comparison operators.

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.

Submit
23. 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.

Submit
24. 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.

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.

Submit
25. 167. In the code shown above, the ____ clause begins the outer loop.

Explanation

The correct answer is "while (region

Submit
26. 181. The scope of a variable can be either ____.

Explanation

The scope of a variable refers to the part of a program where the variable is accessible. A local variable is one that is declared within a specific block of code, such as a function, and can only be accessed within that block. On the other hand, a global variable is one that is declared outside of any specific block and can be accessed from anywhere in the program. Therefore, the scope of a variable can be either local or global, depending on where it is declared.

Submit
27. 165. The do while statement ends with a(n) ____.

Explanation

The do while statement ends with a semicolon (;). This is because the semicolon is used to terminate a statement in many programming languages, including C++. In the context of a do while loop, the semicolon indicates the end of the loop body and is placed immediately after the closing brace (}) of the loop block.

Submit
28. 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.

Submit
29. 154. In a flowchart, the repetition symbol contains the loop ____.

Explanation

The repetition symbol in a flowchart represents a loop, and the correct answer for the loop component that it contains is the "condition". This means that the loop will continue to repeat as long as the specified condition is true. The condition acts as a control mechanism for the loop, determining when it should stop executing and when it should continue.

Submit
30. 201. The information in a(n) ____ access file is always accessed in consecutive order from the beginning of the filethrough the end of the file.

Explanation

A sequential access file is a type of file where the data is stored and accessed in a sequential order, starting from the beginning of the file and moving towards the end. This means that the data can only be accessed in the order it was written into the file. Unlike random access files where data can be accessed in any order, sequential access files are read or written sequentially, making them suitable for tasks that require reading or writing data in a linear manner. Therefore, the correct answer is sequential.

Submit
31. 206. When using the open() function, you use the ____ mode to open a file for input.

Explanation

When using the open() function, you use the ios::in mode to open a file for input. This mode allows the program to read data from the file.

Submit
32. 157. ____ means to assign a beginning value to a counter or accumulator variable.

Explanation

Initializing means to assign a beginning value to a counter or accumulator variable. It is the process of setting the initial state or value of a variable before it is used in a program. By initializing a variable, we ensure that it starts with a known value, which can be important in calculations or loops where the variable's value is updated or incremented. This helps in maintaining the accuracy and reliability of the program's logic and results.

Submit
33. 160. The repetition structure is referred to more simply as a(n) ____.

Explanation

The correct answer is "loop" because a repetition structure is a programming construct that allows a set of instructions to be executed repeatedly until a certain condition is met. This term is commonly referred to as a "loop" because it creates a cycle of executing the same set of instructions multiple times.

Submit
34. 171. A(n) ____ is a block of code that performs a task.

Explanation

A function is a block of code that performs a specific task. It is a reusable piece of code that can be called or invoked multiple times throughout a program. Functions help in organizing code and improving code reusability. They can accept input parameters, perform operations, and return a value if required. In this context, a function is the most appropriate option as it accurately describes a block of code that performs a task.

Submit
35. 120. ____ is a character literal constant.

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.

Submit
36. 152. Values that are used to end loops are referred to as ____ values.

Explanation

Sentinel values are used to indicate the end of a loop. They are typically predefined values that are used to terminate the loop when encountered. In this context, the sentinel value is used to signal the loop to stop iterating and exit. The other options listed, such as iterator, break, and accumulator, do not specifically refer to values used to end loops.

Submit
37. 112. ____ is called the insertion operator.

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.

Submit
38. 121. ____ is a string literal constant.

Explanation

The empty string "" is a string literal constant. It represents a string that contains no characters.

Submit
39. 146. In a flowchart, the switch symbol has ____ flowline(s) leading out of the symbol.

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.

Submit
40. 166. You can stop an endless loop either by pressing ____ or by clicking the Close button on the Command Prompt window.
int sales = 0;
int region = 1;
int totRegSales = 0;
while (region < 3)
{
cout << "First sales amount for Region "
<< region << ": ";
cin >> sales;
while (sales > 0)
{
totRegSales = totRegSales + sales;
cout << "Next sales amount for Region "
<< region << ": ";
cin >> sales;
} //end while
cout << endl << "Region " << region << " sales: $"
<< totRegSales << endl << endl;
region = region + 1;
totRegSales = 0;
} //end while
cout << "End of program" << endl;

Explanation

You can stop an endless loop either by pressing Ctrl+c c or by clicking the Close button on the Command Prompt window.

Submit
41. 188. The function prototype ____ indicates that the first two variables are passed by value, while the third and fourth variables are passed by reference.

Explanation

The correct answer is "void calc(double, double, double &, double &);" because the "&" symbol before the last two variables indicates that they are passed by reference. Passing by reference allows the function to modify the values of the variables directly, rather than creating a copy of the variables. The absence of any other symbols or modifiers in the function prototype indicates that the first two variables are passed by value, meaning their values are copied into the function.

Submit
42. 192. ____ declares and initializes a four-element string array named states; each element is initialized to the empty string.

Explanation

The correct answer is "string states[4] = {""};" because it declares and initializes a four-element string array named states, where each element is initialized to the empty string.

Submit
43. 200. The information in a(n) ____ access file can be accessed by its byte location in the file.

Explanation

A binary access file allows for direct access to specific bytes within the file. Unlike sequential access, which requires reading through the file sequentially from the beginning, or random access, which requires an index or key to access specific records, binary access allows for direct retrieval of data based on its byte location. This makes it efficient for accessing and manipulating data at specific positions within the file.

Submit
44. 208. The ____ statement tells the computer to open for append the employ.txt file located on the A drive.

Explanation

The correct answer is outEmploy.open("a:\employ.txt",ios::app); because it uses the correct syntax to open the employ.txt file located on the A drive for append. The "a:\" specifies the drive and the "employ.txt" specifies the file name. The ios::app flag is used to open the file in append mode, which means that any data written to the file will be added to the end of the existing content.

Submit
45. 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 ____.

Explanation

not-available-via-ai

Submit
46. 184. The function body in a ____ function does not contain a return expression; statement.

Explanation

A void function is a program-defined function that does not contain a return expression or statement. This means that when the function is called, it performs certain actions or operations but does not return any value back to the caller. Void functions are commonly used when there is no need to return a result or when the desired outcome is achieved through side effects, such as modifying global variables or printing output.

Submit
47. 207. The scope resolution operator in C++ is ____.

Explanation

The scope resolution operator in C++ is "::". This operator is used to access members of a class or namespace that are defined outside of the class or namespace. It allows the programmer to specify the exact scope from which they want to access the member.

Submit
48. 147. In C++, you use the ____ statement to code the switch form of the selection structure.

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".

Submit
49. 191. A subscript is also called a(n) ____.

Explanation

A subscript is also called an index because it is used to access specific elements in a data structure, such as an array or a list. The index represents the position or location of an element within the data structure, allowing for easy retrieval and manipulation of the desired element.

Submit
50. 195. When using bubble sort to sort an array in ascending order, at the end of the first pass, the ____ value is stored in the last position of the array.

Explanation

At the end of the first pass of the bubble sort algorithm, the largest value in the array is moved to the last position. This is because bubble sort compares adjacent elements and swaps them if they are in the wrong order. During the first pass, the largest element "bubbles" up to the end of the array.

Submit
51. 197. The ____ statement shows a function call that passes the prices array to the displayArray() function.

Explanation

The correct answer is displayArray(prices) because it correctly calls the displayArray() function and passes the prices array as an argument. The other options are incorrect because they either use incorrect syntax or attempt to pass the array in a way that is not compatible with the function's parameter.

Submit
52. 198. Variables located in the first row in a two-dimensional array are assigned a row subscript of ____.

Explanation

In a two-dimensional array, the first row is assigned a row subscript of 0. This means that the first row is accessed using the index 0. The row subscript indicates the position or location of the row within the array. Since arrays in many programming languages start indexing from 0, the first row is assigned a subscript of 0 rather than 1.

Submit
53. 211. A ____ is a single item of information about a person, place, or thing—for example, a name, a salary, a Social Security number, or a price.

Explanation

A field is a single item of information about a person, place, or thing. It can be any specific piece of data such as a name, a salary, a Social Security number, or a price. Fields are used to store and organize data in a database or spreadsheet. They are essential for categorizing and retrieving information efficiently.

Submit
54. 107. A programmer ____ a program by running it on the computer, using sample data to test the program’s accuracy.

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.

Submit
55. 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 ____.

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.

Submit
56. 125. The statement ____ creates a string variable named company and initializes it to the empty string.

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.

Submit
57. 155. In a flowchart, the repetition symbol has ____ flowline(s) leading into the symbol.

Explanation

In a flowchart, the repetition symbol typically has two flowlines leading into the symbol. This indicates that the process or set of instructions within the symbol will be repeated a certain number of times. The two flowlines represent the beginning and end of the loop, allowing the flow of control to go back and repeat the specified instructions.

Submit
58. 174. In .NET C++, you use the ____ class to generate random numbers.

Explanation

In .NET C++, the Random class is used to generate random numbers. This class provides methods to generate random integers, doubles, and other data types. It allows you to specify a range for the generated numbers and provides various methods for generating random numbers based on different algorithms. Therefore, the correct answer is Random.

Submit
59. 189. ____ is an example of a valid function call.

Explanation

The correct answer is "calc(salary, raiseRate, raise,newSalary)" because it matches the function call format of the declared function "void calc(double, double, double &, double &)" where the arguments are passed in the correct order and types.

Submit
60. 212. You close a file using the ____ function.

Explanation

The correct answer is "close()". When you are done working with a file in programming, you need to close it to free up system resources. The "close()" function is used to close a file. This ensures that any changes made to the file are saved and the file is no longer accessible for reading or writing.

Submit
61. 215. ____ is the object-oriented feature that allows the same instruction to be carried out differently depending on the object.

Explanation

Polymorphism is the object-oriented feature that allows the same instruction to be carried out differently depending on the object. It enables objects of different classes to be treated as objects of a common superclass, allowing methods to be defined in the superclass and overridden in the subclasses. This allows for flexibility and reusability in code, as different objects can respond differently to the same method call. Polymorphism promotes code extensibility and modularity, making it a fundamental concept in object-oriented programming.

Submit
62. 216. In addition to using the classes built into C++, you also can define your own classes and then create instances (____) from those classes.

Explanation

In C++, you have the ability to define your own classes. Once you have defined a class, you can create instances of that class, which are known as objects. These objects can be used to store data and perform operations based on the class's defined functions and variables.

Submit
63. 220. Most programmers enter a class definition in a separate file called a(n) ____ file.

Explanation

A class definition is typically entered in a separate file called a header file. This file contains the declarations and definitions of the class, which are then included in other files using the include directive. The header file serves as a blueprint for the class and allows other parts of the program to access and use its functions and variables.

Submit
64. 105. The translation of an algorithm into a language that the computer can understand is referred to as ____ the algorithm.

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.

Submit
65. 126. The ____ function can be used to get string input from the user at the keyboard.

Explanation

The getline() function can be used to get string input from the user at the keyboard.

Submit
66. 128. A(n) ____ selection structure contains only one set of instructions, which are processed when the condition is true.

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.

Submit
67. 202. Before you can write the fourth line in a(n) ____ access file, you first must write lines one through three.

Explanation

In a sequential access file, the data is stored in a specific order and can only be accessed sequentially, meaning that you have to read or write the data in the order it was stored. Therefore, before writing the fourth line in a sequential access file, you must first write lines one through three in the same order.

Submit
68. 144. Multiple-path selection structures are also referred to as ____ selection structures.

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.

Submit
69. 162. Repetitions in a loop are called ____.

Explanation

In programming, when a set of instructions is repeated multiple times, it is referred to as iterations. The term "iterations" is commonly used to describe the repetitive nature of loops in programming. A loop allows a specific block of code to be executed repeatedly until a certain condition is met. Therefore, "iterations" is the appropriate term to describe the repetitions in a loop.

Submit
70. 169. In the code shown above, the ____ clause begins the inner loop.

Explanation

The given code snippet shows a while loop nested within another while loop. The inner loop is responsible for reading the value of "sales" from the user, and it continues to execute as long as the value of "sales" is greater than 0. Therefore, the correct answer is "while (sales > 0)" as it marks the beginning of the inner loop.

Submit
71. 173. Although the value of RAND_MAX varies with different systems, its value is always at least ____.

Explanation

not-available-via-ai

Submit
72. 179. The function body begins with ____.

Explanation

The function body begins with an opening curly brace. This is because in most programming languages, including C++, Java, and JavaScript, the opening curly brace indicates the start of a block of code that belongs to a function. The closing curly brace is used to mark the end of the function body.

Submit
73. 187. A ____ function uses its return value to send information back to the function that called it.

Explanation

A value-returning function is a type of function that uses its return value to send information back to the function that called it. This means that after the value-returning function completes its task, it will return a value that can be used by the calling function. This allows for the transfer of data or results from one function to another, enabling the program to perform more complex operations or make decisions based on the returned value.

Submit
74. 193. The statement ____ assigns the character X to the first element of the letters array.

Explanation

The correct answer is "letters[0] = 'X';" because it assigns the character 'X' to the first element of the letters array. The other options either assign the string "X" or assign the character 'X' to the second element of the array.

Submit
75. 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.

Submit
76. 137. The ____ operator has a higher precedence than the <= operator.

Explanation

The + operator has a higher precedence than the

Submit
77. 103. Some high-level languages use a(n) ____ rather than a(n) ____.

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.

Submit
78. 115. ____ is an example of a syntax error.

Explanation

The line "cout" is an example of a syntax error because it is missing the "

Submit
79. 194. The bubble sort algorithm works by comparing adjacent array elements and interchanging (____) the ones that are out of order.

Explanation

The bubble sort algorithm works by comparing adjacent array elements and interchanging (swapping) the ones that are out of order. This means that if two adjacent elements are not in the correct order, they will be swapped with each other so that they are in the correct order. This process is repeated until the entire array is sorted.

Submit
80. 196. The ____ statement shows the prototype of a function that receives an array of double elements.

Explanation

The correct answer is "void displayArray(double [])". This is because the square brackets "[]" indicate that the function receives an array of double elements. The other options are incorrect because they use different syntax that does not specify an array.

Submit
81. 199. ____ declares and initializes a three-row, two-column char array named grades.

Explanation

The correct answer is "char grades[3][2] = {{'A', 'A'},{'B', 'C'},{'D', 'B'}};". This answer correctly declares and initializes a three-row, two-column char array named grades. The array is initialized with the values 'A', 'A' in the first row, 'B', 'C' in the second row, and 'D', 'B' in the third row.

Submit
82. 217. You specify the attributes and behaviors using a(n) ____.

Explanation

A class definition is used to specify the attributes and behaviors of an object. It defines the structure and behavior of objects of a particular class, including the data members (attributes) and member functions (behaviors) that the objects will have. The class definition serves as a blueprint for creating objects of that class, allowing them to have the same attributes and behaviors. By defining a class, you can create multiple objects with similar properties and functionalities, providing a way to organize and manage data in an object-oriented programming language.

Submit
83. 108. The purpose of analyzing a problem is to determine the goal of solving the problem and the items that are needed to

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.

Submit
84. 118. Variables and ____ are locations (within the computer’s internal memory) where a program can temporarily store data while the program is running.

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.

Submit
85. 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.

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.

Submit
86. 158. In most for clauses, the ____ argument creates and initializes a counter variable.

Explanation

In most for clauses, the "first" argument creates and initializes a counter variable. This means that the counter variable is declared and assigned an initial value at the beginning of the for loop. The counter variable is then used to control the iteration of the loop, typically by incrementing or decrementing its value with each iteration.

Submit
87. 161. Programmers use the ____ structure when they need the computer to repeatedly process one or more program instructions until some condition is met.

Explanation

Programmers use the repetition structure when they need the computer to repeatedly process one or more program instructions until some condition is met. This structure allows them to create loops that will execute a block of code multiple times until a specific condition is satisfied. It is commonly used when there is a need to iterate through a collection of data or perform a specific task multiple times. The repetition structure helps in making programs more efficient and flexible by automating repetitive tasks.

Submit
88. 163. The repetition symbol in a flowchart contains the ____.

Explanation

The repetition symbol in a flowchart contains the loop condition. This condition determines whether the loop should continue or terminate based on a specified condition. It acts as a control mechanism for the loop, allowing it to repeat a certain set of instructions until the condition is no longer met. By evaluating the loop condition at each iteration, the flowchart can determine whether to continue executing the loop or exit it.

Submit
89. 213. The term "encapsulate" means "to enclose in a capsule." In the context of OOP, the "capsule" is a(n) ____.

Explanation

In the context of Object-Oriented Programming (OOP), the term "encapsulate" refers to the process of enclosing data and methods within a class. A class acts as a blueprint or template for creating objects, which are instances of that class. By encapsulating data and methods within a class, we can control access to them and ensure that they are only manipulated in a controlled and consistent manner. Therefore, the correct answer is "class".

Submit
90. 214. An object’s ____ are the operations that the object is capable of performing, or to which the object can respond.

Explanation

Behaviors refer to the operations that an object can perform or respond to. It includes the actions or functions that can be executed by the object. In object-oriented programming, objects are designed to have specific behaviors that define their functionality. These behaviors can be called or invoked by other objects or the system itself. Therefore, the correct answer is behaviors.

Submit
91. 101. Programs written in an assembly language require a(n) ____, which also is a program, to convert the assembly

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.

Submit
92. 150. Pretest loops are also called ____ loops.

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.

Submit
93. 151. The instructions in a ____ loop will be processed at least once.

Explanation

A posttest loop is a type of loop where the condition is checked after the loop body is executed. In this type of loop, the loop body will always be executed at least once before the condition is checked. Therefore, the instructions in a posttest loop will be processed at least once.

Submit
94. 172. You can use the built-in C++ ____ function to raise a number to a power and then return the result as a double number.

Explanation

The correct answer is "pow()". In C++, the "pow()" function is a built-in function that can be used to raise a number to a power. It takes two arguments, the base number and the exponent, and returns the result as a double number. This function is commonly used in mathematical calculations where exponentiation is required.

Submit
95. 209. The computer uses a file ____ to keep track of the next character either to read from or write to a file.

Explanation

A pointer is used by the computer to keep track of the next character either to read from or write to a file. A pointer is a variable that stores the memory address of another variable. In this case, the pointer would store the memory address of the next character in the file, allowing the computer to access it efficiently.

Submit
96. 109. Some programmers use a(n) ____ to organize and summarize the results of a problem analysis.

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.

Submit
97. 127. To use the fixed stream manipulator, the program must contain the ____ statement.

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.

Submit
98. 205. You use the input and output file objects, along with the C++ ____ function, to open actual files on your computer’s disk.

Explanation

The correct answer is "open()". In C++, the "open()" function is used along with the input and output file objects to open actual files on the computer's disk. This function allows the program to access and manipulate the contents of the file by providing the necessary file path and mode (such as read, write, append, etc.).

Submit
99. 210. The ____ is the Not logical operator in C++.

Explanation

The correct answer is "!". In C++, the "!" symbol is used as the Not logical operator. It is used to invert the value of a boolean expression. For example, if a variable "x" is true, using the "!" operator will make it false, and vice versa.

Submit
100. 138. In C++, you can use the ____ function to convert a character to uppercase.

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().

Submit
101. 140. You need to enter the ____ statement in any program that uses the transform() function.

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.

Submit
102. 156. You can code the pretest loop in C++ using the ____ statement.

Explanation

In C++, the pretest loop can be coded using the "for" statement. The "for" loop allows you to specify the initialization, condition, and increment/decrement in a single line, making it convenient for looping a specific number of times. This loop is executed only if the condition is true, making it a pretest loop.

Submit
103. 218. ____ is an example of Pascal case.

Explanation

The correct answer is "FormattedDate" because it follows the Pascal case convention. Pascal case is a naming convention in which each word in a compound word is capitalized, and there are no spaces or underscores between the words. In this case, "FormattedDate" is written in Pascal case, while the other options ("formattedDate", "formatted_date", "formatted-date") do not follow this convention.

Submit
104. 106. A coded algorithm is called a ____.

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.

Submit
105. 159. A common error made by C++ programmers is to separate the arguments in the for clause with ____.

Explanation

A common error made by C++ programmers is to separate the arguments in the for clause with commas. This is incorrect because in C++, the for loop requires semicolons to separate the initialization, condition, and iteration statements. Using commas instead of semicolons can lead to syntax errors and unexpected behavior in the program.

Submit
106. 203. For a program to create a file object, it must contain the ____ directive.

Explanation

The correct answer is #include. In C++ programming, the #include directive is used to include header files in a program. In this case, the program needs to include a file object, so it must use the #include directive to include the necessary header file that defines the file object.

Submit
107. 219. A ____ is a function that is defined in a class definition.

Explanation

A method is a function that is defined in a class definition. In object-oriented programming, a class is a blueprint for creating objects, and methods are the behaviors or actions that an object can perform. Methods are associated with a specific class and can access and manipulate the data within that class. They are used to define the functionality of an object and allow it to interact with other objects in the program. Therefore, a method is the correct answer as it accurately describes the function defined within a class.

Submit
108. 221. ____ is the scope resolution operator.

Explanation

The scope resolution operator in C++ is denoted by "::". It is used to access variables, functions, or classes that are defined in a specific scope or namespace. The "::" operator allows the programmer to differentiate between variables or functions with the same name but defined in different scopes, ensuring the correct one is accessed.

Submit
109. 183. The function header in a void function begins with ____.

Explanation

The function header in a void function begins with the return type 'void', followed by the function name and any parameters enclosed in parentheses. The return type 'void' indicates that the function does not return any value.

Submit
110. 186. ____ function uses variables that are passed by reference to send information back to the function that called it.

Explanation

The void function uses variables that are passed by reference to send information back to the function that called it. In a void function, no value is returned, but it can modify the variables that are passed to it by reference, allowing it to send information back to the calling function. This is useful when we want to modify variables in the calling function without returning a value.

Submit
111. 182. A ____ function returns precisely one value to the statement that called the function.

Explanation

A value-returning function is a type of function that is designed to return precisely one value to the statement that called the function. This means that when the function is executed, it will perform some operations and then return a value back to the calling statement. This value can then be used for further calculations or processing within the program.

Submit
112. 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.

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.

Submit
113. 180. A variable’s ____ indicates how long the variable remains in the computer’s internal memory.

Explanation

The term "lifetime" refers to the duration or length of time that a variable remains in the computer's internal memory. It indicates how long the variable will be available for use in the program before it is deallocated or removed from memory. The lifetime of a variable is an important concept in programming, as it determines when the variable can be accessed and when it will be destroyed.

Submit
114. 185. Passing a variable’s value to a function is referred to as passing by ____.

Explanation

Passing a variable's value to a function is referred to as passing by value.

Submit
115. 131. Comparison operators are often referred to as ____ operators.

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.

Submit
116. 139. You need to enter the ____ directive in any program that uses the transform() function.

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.

Submit
117. 119. Examples of ____ in the C++ programming language include int, double, and return.

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.

Submit
118. 178. The items of information you pass to a function are called ____.

Explanation

When calling a function, the values that are passed to it are known as actual arguments. These arguments are the specific data or variables that are provided to the function when it is called. The function then uses these arguments to perform its operations and return a result if necessary. In contrast, formal parameters are the variables or placeholders defined in the function's declaration, which are used to receive and process the actual arguments passed to the function.

Submit
119. 170. In the code shown above, the computer continues processing the outer loop’s instructions until the value stored in the region variable is ____.

Explanation

In the code shown above, the computer continues processing the outer loop's instructions until the value stored in the region variable is 3.

Submit
120. 164. Step 1 in the following algorithm contains the ____.
1. enter the sales
2. repeat while (the sales are not equal to –1)
bonus = sales * bonus rate
display the bonus
enter the sales
end repeat while

Explanation

The correct answer is "priming read". In the given algorithm, step 1 is where the sales value is entered. This initial input of the sales value before entering the loop is known as a priming read. It is necessary to have a starting value for the loop condition to be evaluated correctly.

Submit
121. 204. A program that creates an input file object should include the using std::ifstream; and ____ statements.

Explanation

The correct answer is using std::ios; because std::ios is the standard header file for input/output operations in C++. Including this statement allows the program to use the input/output stream classes and their associated functions, such as ifstream for reading from a file. The other options (fstream, stdlib, file) are not necessary for creating an input file object.

Submit
122. 153. In a loop, the ____ read is used to prepare or set up the loop.

Explanation

In a loop, the priming read is used to prepare or set up the loop. This means that before the loop starts executing, the priming read is used to initialize any necessary variables or conditions that are needed for the loop to function properly. It ensures that the loop starts with the correct initial values or conditions before proceeding with the rest of the loop logic.

Submit
View My Results

Quiz Review Timeline (Updated): Aug 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Aug 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 22, 2009
    Quiz Created by
    Mrmirante
Cancel
  • All
    All (122)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
177. The ____ store the information passed to the function when the...
122. When a program instructs the computer to assign a value to a...
130. In a flowchart, there is/are ____ flowline(s) leading out of the...
102. The repetition structure is also referred to as a loop or as...
141. A(n) ____ is a set of step-by-step instructions that accomplish a...
175. The modulus arithmetic operator (____) divides two integers and...
222. When two or more methods have the same name but different...
145. The flowchart symbol for the switch form of the selection...
114. ____ refers to the process of locating and removing any errors in...
176. To use the time() function in a program, the program must contain...
110. In a flowchart, the oval symbol is called the ____ symbol.
133. You use ____ to test for equality in C++.
135. The And operator in C++ is ____.
148. In C++, the switch statement begins with the switch clause...
113. ____ is called the extraction operator.
123. After executing the following lines of code, the result will be...
168. In the code shown above, the ____ variable is used as a counter.
190. When the computer processes the return 0; statement in the main()...
129. The ____ in a flowchart is called the selection/repetition...
134. When the ____ logical operator is used to create a compound...
104. The Windows environment typically uses ____ such as check boxes,...
132. You can use ____ to override the order of precedence of...
136. The Or operator in C++ is ____.
143. A common error made when writing selection structures is to use a...
167. In the code shown above, the ____ clause begins the outer loop.
181. The scope of a variable can be either ____.
165. The do while statement ends with a(n) ____.
111. In a flowchart, the parallelogram symbol is called the ____...
154. In a flowchart, the repetition symbol contains the loop ____.
201. The information in a(n) ____ access file is always accessed in...
206. When using the open() function, you use the ____ mode to open a...
157. ____ means to assign a beginning value to a counter or...
160. The repetition structure is referred to more simply as a(n) ____.
171. A(n) ____ is a block of code that performs a task.
120. ____ is a character literal constant.
152. Values that are used to end loops are referred to as ____ values.
112. ____ is called the insertion operator.
121. ____ is a string literal constant.
146. In a flowchart, the switch symbol has ____ flowline(s) leading...
166. You can stop an endless loop either by pressing ____ or by...
188. The function prototype ____ indicates that the first two...
192. ____ declares and initializes a four-element string array named...
200. The information in a(n) ____ access file can be accessed by its...
208. The ____ statement tells the computer to open for append the...
142. If the code is X and the sales amount is 15000, the value of the...
184. The function body in a ____ function does not contain a return...
207. The scope resolution operator in C++ is ____.
147. In C++, you use the ____ statement to code the switch form of the...
191. A subscript is also called a(n) ____.
195. When using bubble sort to sort an array in ascending order, at...
197. The ____ statement shows a function call that passes the prices...
198. Variables located in the first row in a two-dimensional array are...
211. A ____ is a single item of information about a person, place, or...
107. A programmer ____ a program by running it on the computer, using...
116. When you compile a Microsoft Visual C++ 2005 program, the...
125. The statement ____ creates a string variable named company and...
155. In a flowchart, the repetition symbol has ____ flowline(s)...
174. In .NET C++, you use the ____ class to generate random numbers.
189. ____ is an example of a valid function call.
212. You close a file using the ____ function.
215. ____ is the object-oriented feature that allows the same...
216. In addition to using the classes built into C++, you also can...
220. Most programmers enter a class definition in a separate file...
105. The translation of an algorithm into a language that the computer...
126. The ____ function can be used to get string input from the user...
128. A(n) ____ selection structure contains only one set of...
202. Before you can write the fourth line in a(n) ____ access file,...
144. Multiple-path selection structures are also referred to as ____...
162. Repetitions in a loop are called ____.
169. In the code shown above, the ____ clause begins the inner loop.
173. Although the value of RAND_MAX varies with different systems, its...
179. The function body begins with ____.
187. A ____ function uses its return value to send information back to...
193. The statement ____ assigns the character X to the first element...
117. A #include ____ provides a convenient way to merge the source...
137. The ____ operator has a higher precedence than the <=...
103. Some high-level languages use a(n) ____ rather than a(n) ____.
115. ____ is an example of a syntax error.
194. The bubble sort algorithm works by comparing adjacent array...
196. The ____ statement shows the prototype of a function that...
199. ____ declares and initializes a three-row, two-column char array...
217. You specify the attributes and behaviors using a(n) ____.
108. The purpose of analyzing a problem is to determine the goal of...
118. Variables and ____ are locations (within the computer’s...
124. The ____ statement tells the computer to convert the double...
158. In most for clauses, the ____ argument creates and initializes a...
161. Programmers use the ____ structure when they need the computer to...
163. The repetition symbol in a flowchart contains the ____.
213. The term "encapsulate" means "to enclose in a capsule." In the...
214. An object’s ____ are the operations that the object is capable...
101. Programs written in an assembly language require a(n) ____, which...
150. Pretest loops are also called ____ loops.
151. The instructions in a ____ loop will be processed at least once.
172. You can use the built-in C++ ____ function to raise a number to a...
209. The computer uses a file ____ to keep track of the next character...
109. Some programmers use a(n) ____ to organize and summarize the...
127. To use the fixed stream manipulator, the program must contain the...
205. You use the input and output file objects, along with the C++...
210. The ____ is the Not logical operator in C++.
138. In C++, you can use the ____ function to convert a character to...
140. You need to enter the ____ statement in any program that uses the...
156. You can code the pretest loop in C++ using the ____ statement.
218. ____ is an example of Pascal case.
106. A coded algorithm is called a ____.
159. A common error made by C++ programmers is to separate the...
203. For a program to create a file object, it must contain the ____...
219. A ____ is a function that is defined in a class definition.
221. ____ is the scope resolution operator.
183. The function header in a void function begins with ____.
186. ____ function uses variables that are passed by reference to send...
182. A ____ function returns precisely one value to the statement that...
149. In the switch statement, when the selectorExpression does not...
180. A variable’s ____ indicates how long the variable remains in...
185. Passing a variable’s value to a function is referred to as...
131. Comparison operators are often referred to as ____ operators.
139. You need to enter the ____ directive in any program that uses the...
119. Examples of ____ in the C++ programming language include int,...
178. The items of information you pass to a function are called ____.
170. In the code shown above, the computer continues processing the...
164. Step 1 in the following algorithm contains the ____.1. enter the...
204. A program that creates an input file object should include the...
153. In a loop, the ____ read is used to prepare or set up the loop.
Alert!

Advertisement