MCQOPTIONS
Saved Bookmarks
This section includes 542 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science knowledge and support exam preparation. Choose a topic below to get started.
| 251. |
A C++ term meaning "generic" is |
| A. | argument |
| B. | parameterized |
| C. | universal |
| D. | global |
| Answer» C. universal | |
| 252. |
Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _____ |
| A. | the tasks are not done in order |
| B. | the tasks are simpler |
| C. | the tasks share data |
| D. | the tasks do not share data |
| Answer» E. | |
| 253. |
The two parts of a function are the |
| A. | header and footer |
| B. | declarations and statements |
| C. | legs and feet |
| D. | header and body |
| Answer» E. | |
| 254. |
Which of the following is a string literal constant? |
| A. | "Visual C++" |
| B. | "137.45" |
| C. | "A" |
| D. | "2,365" |
| Answer» E. | |
| 255. |
Within parentheses, catch blocks can have _____ |
| A. | no arguments |
| B. | one argument |
| C. | two arguments |
| D. | as many arguments as necessary |
| Answer» C. two arguments | |
| 256. |
The feature that allows you to use the same function name for separate functions that have different argument lists is called _____ |
| A. | overriding |
| B. | overloading |
| C. | constructing |
| D. | destructing |
| Answer» C. constructing | |
| 257. |
Software that can be used in applications other than the one for which it was originally written is called |
| A. | recyclable |
| B. | inherited |
| C. | reusable |
| D. | cheating |
| Answer» D. cheating | |
| 258. |
The C++ keyword for declaring a variable that contains a decimal point is _____ |
| A. | dec |
| B. | decimal |
| C. | float |
| D. | floater |
| Answer» D. floater | |
| 259. |
Another drawback to returning an error code from a function is that any error code returned by the function |
| A. | must be of the same type as return type of the function |
| B. | must not be a character |
| C. | cannot be checked in a main() program |
| D. | can have multiple meanings |
| Answer» B. must not be a character | |
| 260. |
A constructor initialization list produces similar results to |
| A. | overriding |
| B. | assignment |
| C. | redeclaring |
| D. | output |
| Answer» C. redeclaring | |
| 261. |
In the C language, the character type of constant is delimited by using |
| A. | single quotes |
| B. | double quotes |
| C. | parenthesis |
| D. | # |
| Answer» B. double quotes | |
| 262. |
An object is a(n) _____ of a class |
| A. | owner |
| B. | function |
| C. | definition |
| D. | instance |
| Answer» E. | |
| 263. |
The statement fwrite ( (char*)&objl, sizeof(objl) ); |
| A. | writes the member functions of objl to fl |
| B. | writes the data in objl to fl |
| C. | writes the member functions and me data of obj 1 to fl |
| D. | writes the address of objl to fl |
| Answer» C. writes the member functions and me data of obj 1 to fl | |
| 264. |
Which of the following tells C++ to display numbers with zero decimal places? |
| A. | setiosflags(0) |
| B. | setiosflags(zero) |
| C. | setprecision(0) |
| D. | setprecision(zero) |
| Answer» D. setprecision(zero) | |
| 265. |
Which of the following is a C++ class? |
| A. | >> |
| B. | read() |
| C. | cin |
| D. | iostream |
| Answer» E. | |
| 266. |
Catch blocks must _____ |
| A. | appear in every object-oriented program |
| B. | appear within try blocks |
| C. | appear immediately after throw statements |
| D. | appear immediately after try blocks |
| Answer» E. | |
| 267. |
In C++, a function contained within a class is called |
| A. | a member function |
| B. | an operator |
| C. | a class function |
| D. | a method |
| Answer» B. an operator | |
| 268. |
The function strcmp("Jose", "JOSE") will return _____ |
| A. | -1 |
| B. | 0 |
| C. | 1 |
| Answer» D. | |
| 269. |
A variable's _____ indicates how long the variable remains in the computer's memory |
| A. | area |
| B. | extent |
| C. | lifetime |
| D. | reach |
| Answer» D. reach | |
| 270. |
In the C language, a string is assigned to the |
| A. | char type of variable |
| B. | string type of variable |
| C. | conversion specification %s |
| D. | All of the above |
| Answer» B. string type of variable | |
| 271. |
A programming structure that contains data and a pointer to the next object is a |
| A. | template |
| B. | class |
| C. | pointer class |
| D. | linked list |
| Answer» E. | |
| 272. |
You typically initialize Short Integer, Integer, and Long Integer variables to |
| A. | a space enclosed in double quotes |
| B. | a space enclosed in single quotes |
| C. | the letter O |
| D. | the number 0 |
| Answer» E. | |
| 273. |
A function stub typically contains |
| A. | the function header |
| B. | the function braces |
| C. | the return statement, if it's value- returning function |
| D. | a display message |
| Answer» E. | |
| 274. |
The complement operator is represented by the symbol |
| A. | ~ |
| B. | ^ |
| C. | i |
| D. | < |
| Answer» B. ^ | |
| 275. |
When a variable exists or is accessible, it is said to be _____ |
| A. | immediate |
| B. | in the path |
| C. | available |
| D. | in scope |
| Answer» E. | |
| 276. |
Machine code is _____ |
| A. | edited code |
| B. | source code |
| C. | the 0s and 1s that the computer can understand |
| D. | both (b) and (c) |
| Answer» D. both (b) and (c) | |
| 277. |
You can code a default exception handler by creating a catch block |
| A. | with no arguments |
| B. | with a void argument |
| C. | with an ellipsis as its argument |
| D. | with an argument identical to that thrown |
| Answer» D. with an argument identical to that thrown | |
| 278. |
The following statement where T is true and F is false T&&T||F&&T |
| A. | is true |
| B. | is false |
| C. | is wrong |
| D. | not applicable in C language |
| Answer» B. is false | |
| 279. |
The getline() function reads a line of text until _____ |
| A. | the length used as the second argument is reached |
| B. | the character used as the third argument is reached |
| C. | either (a) or (b) |
| D. | neither (a) nor (b) |
| Answer» D. neither (a) nor (b) | |
| 280. |
A derived class may also be called a |
| A. | subclass |
| B. | super class |
| C. | parent class |
| D. | derived class |
| Answer» B. super class | |
| 281. |
If you omit any constructor argument when you instantiate an object, you must use default values______ |
| A. | for all parameters to the constructor |
| B. | for all parameters to the right of the argument |
| C. | for all parameters to the left of the argument |
| D. | for no other parameters |
| Answer» C. for all parameters to the left of the argument | |
| 282. |
Elements in an array are identified by a unique _____ |
| A. | data type |
| B. | order |
| C. | subscript |
| D. | symbol |
| Answer» D. symbol | |
| 283. |
A comment |
| A. | is a note that can be put into the source code |
| B. | is ignored by the compiler. |
| C. | starts with the /* character pair |
| D. | All of the above |
| Answer» E. | |
| 284. |
A default exception block must be placed _____ |
| A. | first among the catch blocks |
| B. | last among the catch blocks |
| C. | globally, at the top of the file |
| D. | at the end of all code in the program |
| Answer» C. globally, at the top of the file | |
| 285. |
A child class _____ exist if there is no parent class |
| A. | must |
| B. | may |
| C. | cannot |
| D. | can |
| Answer» D. can | |
| 286. |
You can place function templates |
| A. | at the end of main() |
| B. | at the start of a program above main() |
| C. | in two files-one for the definition and one for the function |
| D. | any of the above |
| Answer» C. in two files-one for the definition and one for the function | |
| 287. |
Which of the following is false? |
| A. | You enclose a function's statements in a set of braces |
| B. | The function header is considered a C++ statement, so it must end in a semicolon. |
| C. | The keyword void tells the C++ compiler that the function does not return a value |
| D. | A function can receive information that you send (pass) to it |
| Answer» C. The keyword void tells the C++ compiler that the function does not return a value | |
| 288. |
Any output manipulator function you create _____ |
| A. | should take as an argument an instance of ostream as a reference |
| B. | should return void |
| C. | must be a member function of the ostream class |
| D. | must inherit ostream |
| Answer» B. should return void | |
| 289. |
The most common operation used in constructors is |
| A. | addition |
| B. | overloading |
| C. | assignment |
| D. | polymorphism |
| Answer» D. polymorphism | |
| 290. |
The feature that allows the same operations to be carried out differently depending on the object is _____ |
| A. | polymorphism |
| B. | polygamy |
| C. | inheritane |
| D. | multitasking |
| Answer» B. polygamy | |
| 291. |
The indirection operator is the |
| A. | asterisk |
| B. | ampersand |
| C. | dollar sign |
| D. | plus sign |
| Answer» B. ampersand | |
| 292. |
Values that are used to end loops are referred to as _____ values |
| A. | end |
| B. | finish |
| C. | sentinel |
| D. | stop |
| Answer» D. stop | |
| 293. |
Assume that a program creates and initializes a Short Integer variable named age and a pointer named agePtr, to which it assigns the address of the age variable. Which of the following statements will assign the number 21 to the age variable? |
| A. | age = 21; |
| B. | *age = 21; |
| C. | agePtr = 21; |
| D. | *agePtr = 21; |
| Answer» E. | |
| 294. |
If you declare two objects as Customer firstCust, secondCust; which of the following must be true? |
| A. | Each object's nonstatic data members will be stored in the same memory location |
| B. | Each object will be stored in the same memory location |
| C. | Each object will have a unique memory address |
| D. | You cannot declare two objects of the same class |
| Answer» D. You cannot declare two objects of the same class | |
| 295. |
If you want to use a class to define objects in many different programs, you should define the class in a C++ _____ file |
| A. | header |
| B. | program |
| C. | source |
| D. | text |
| Answer» B. program | |
| 296. |
Which of the following operators is the equality operator? |
| A. | != |
| B. | = |
| C. | == |
| D. | ->> |
| Answer» D. ->> | |
| 297. |
If a class will serve as a base class, most often the base class data members are |
| A. | private |
| B. | protected |
| C. | public |
| D. | polymorphic |
| Answer» D. polymorphic | |
| 298. |
The general form of do-while statement is |
| A. | do expression while statement; |
| B. | do while expression; |
| C. | do statement while (expression); |
| D. | do statement while statement; |
| Answer» D. do statement while statement; | |
| 299. |
A function can make_________ |
| A. | one throw |
| B. | one throw of each scalar type |
| C. | one throw of each programmer-defined type |
| D. | as many throws of as many types as necessary |
| Answer» E. | |
| 300. |
You define a structure type globally because |
| A. | you save many lines of code by not rewriting an identical structure definition in each function that uses it |
| B. | you will never change its definition |
| C. | it is required in C++ |
| D. | all of the above |
| Answer» B. you will never change its definition | |