MCQOPTIONS
Saved Bookmarks
This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
A C++ term meaning "generic" is |
| A. | argument |
| B. | parameterized |
| C. | universal |
| D. | global |
| Answer» C. universal | |
| 2. |
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. | |
| 3. |
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. | |
| 4. |
Which of the following is a string literal constant? |
| A. | "Visual C++" |
| B. | "137.45" |
| C. | "A" |
| D. | "2,365" |
| Answer» E. | |
| 5. |
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 | |
| 6. |
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 | |
| 7. |
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 | |
| 8. |
The C++ keyword for declaring a variable that contains a decimal point is _____ |
| A. | dec |
| B. | decimal |
| C. | float |
| D. | floater |
| Answer» D. floater | |
| 9. |
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 | |
| 10. |
A constructor initialization list produces similar results to |
| A. | overriding |
| B. | assignment |
| C. | redeclaring |
| D. | output |
| Answer» C. redeclaring | |
| 11. |
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 | |
| 12. |
An object is a(n) _____ of a class |
| A. | owner |
| B. | function |
| C. | definition |
| D. | instance |
| Answer» E. | |
| 13. |
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 | |
| 14. |
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) | |
| 15. |
Which of the following is a C++ class? |
| A. | >> |
| B. | read() |
| C. | cin |
| D. | iostream |
| Answer» E. | |
| 16. |
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. | |
| 17. |
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 | |
| 18. |
The function strcmp("Jose", "JOSE") will return _____ |
| A. | -1 |
| B. | 0 |
| C. | 1 |
| Answer» D. | |
| 19. |
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 | |
| 20. |
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 | |
| 21. |
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. | |
| 22. |
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. | |
| 23. |
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. | |
| 24. |
The complement operator is represented by the symbol |
| A. | ~ |
| B. | ^ |
| C. | i |
| D. | < |
| Answer» B. ^ | |
| 25. |
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. | |
| 26. |
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) | |
| 27. |
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 | |
| 28. |
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 | |
| 29. |
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) | |
| 30. |
A derived class may also be called a |
| A. | subclass |
| B. | super class |
| C. | parent class |
| D. | derived class |
| Answer» B. super class | |
| 31. |
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 | |
| 32. |
Elements in an array are identified by a unique _____ |
| A. | data type |
| B. | order |
| C. | subscript |
| D. | symbol |
| Answer» D. symbol | |
| 33. |
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. | |
| 34. |
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 | |
| 35. |
A child class _____ exist if there is no parent class |
| A. | must |
| B. | may |
| C. | cannot |
| D. | can |
| Answer» D. can | |
| 36. |
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 | |
| 37. |
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 | |
| 38. |
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 | |
| 39. |
The most common operation used in constructors is |
| A. | addition |
| B. | overloading |
| C. | assignment |
| D. | polymorphism |
| Answer» D. polymorphism | |
| 40. |
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 | |
| 41. |
The indirection operator is the |
| A. | asterisk |
| B. | ampersand |
| C. | dollar sign |
| D. | plus sign |
| Answer» B. ampersand | |
| 42. |
Values that are used to end loops are referred to as _____ values |
| A. | end |
| B. | finish |
| C. | sentinel |
| D. | stop |
| Answer» D. stop | |
| 43. |
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. | |
| 44. |
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 | |
| 45. |
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 | |
| 46. |
Which of the following operators is the equality operator? |
| A. | != |
| B. | = |
| C. | == |
| D. | ->> |
| Answer» D. ->> | |
| 47. |
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 | |
| 48. |
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; | |
| 49. |
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. | |
| 50. |
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 | |