MCQOPTIONS
Saved Bookmarks
This section includes 4320 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
| 651. |
In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process? |
| A. | 'for' and 'while' |
| B. | 'while' and 'if-else' |
| C. | 'do-while' and 'if-else' |
| D. | 'while' and 'do-while' |
| E. | None of the above |
| Answer» E. None of the above | |
| 652. |
Using a statement at the wrong time or with an inappropriate object creates a |
| A. | logical error |
| B. | syntax error |
| C. | compiler error |
| D. | language error |
| Answer» B. syntax error | |
| 653. |
When you create a derived class and instantiate an object _____ |
| A. | the parent class object must be constructed first |
| B. | the child class object must be constructed first |
| C. | the parent class object must not be constructed |
| D. | the child class object must not be constructed |
| Answer» B. the child class object must be constructed first | |
| 654. |
Evaluate the following expression: 4 >6 || 10 < 2 * 6 |
| A. | True |
| B. | False |
| Answer» B. False | |
| 655. |
To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program |
| A. | calculation.h |
| B. | compute.h |
| C. | expression.h |
| D. | math.h |
| E. | mathematical.h |
| Answer» E. mathematical.h | |
| 656. |
The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is_____ |
| A. | inheritance |
| B. | polymorphism |
| C. | overfunctioning |
| D. | overriding |
| Answer» C. overfunctioning | |
| 657. |
When an argument is passed by reference, |
| A. | a variable is created in the function to hold the argument's value |
| B. | the function cannot access the argument's value |
| C. | a temporary variable is created in the calling program to hold the argument's value |
| D. | the function accesses the argument's original value in the calling program |
| E. | None of the above |
| Answer» E. None of the above | |
| 658. |
A constructor always has |
| A. | communicational cohesion |
| B. | temporal cohesion |
| C. | logical cohesion |
| D. | no cohesion |
| Answer» C. logical cohesion | |
| 659. |
The return type you code for all constructors is _____ |
| A. | void |
| B. | the class type |
| C. | the same type as the first data member defined in the class |
| D. | no type |
| Answer» E. | |
| 660. |
When an object-oriented program detects an error within a function, the function _________ |
| A. | throws an exception |
| B. | throws a fit |
| C. | catches a message |
| D. | catches an exception |
| Answer» B. throws a fit | |
| 661. |
The process of extracting the relevant attributes of an object is known as |
| A. | polymorphism |
| B. | inheritance |
| C. | abstraction |
| D. | data hiding |
| Answer» D. data hiding | |
| 662. |
You separate a derived class name from its access specifier with |
| A. | a colon |
| B. | two colons |
| C. | at least one space |
| D. | a semicolon |
| Answer» D. a semicolon | |
| 663. |
Variables declared outside a block are called _____ |
| A. | global |
| B. | universal |
| C. | stellar |
| D. | external |
| Answer» B. universal | |
| 664. |
When you omit parameters from a function call, values can be provided by |
| A. | formal parameters |
| B. | reference parameters |
| C. | overloaded parameters |
| D. | default parameters |
| Answer» E. | |
| 665. |
The first element in a string is |
| A. | the name of the string |
| B. | the first character in the string |
| C. | the length of the string |
| D. | the name of the array holding the string |
| Answer» C. the length of the string | |
| 666. |
The compiler converts your C++ instructions into _____ |
| A. | edited code |
| B. | object code |
| C. | source code |
| D. | translated code |
| Answer» C. source code | |
| 667. |
The logical NOT operator represented by is a |
| A. | unary operator |
| B. | binary operator |
| C. | ternary operator |
| D. | octal operator |
| E. | None of the above |
| Answer» B. binary operator | |
| 668. |
When variables refer to attributes of an entity (such as name, address, and phone number of a person), those attributes form a _____ |
| A. | file |
| B. | record |
| C. | field |
| D. | program |
| Answer» C. field | |
| 669. |
A(n) _____ is a numeric variable used for counting something |
| A. | accumulator |
| B. | adder |
| C. | constant |
| D. | counter |
| E. | integer |
| Answer» E. integer | |
| 670. |
The element of an array is |
| A. | the name of the array |
| B. | a member of an array |
| C. | a value assigned to an array |
| D. | All of the above |
| Answer» C. a value assigned to an array | |
| 671. |
When the function void someFunction(int x) throw(char) is executed,_____ |
| A. | it will throw nothing |
| B. | it may throw an integer |
| C. | it may throw a character |
| D. | it may not throw anything |
| Answer» D. it may not throw anything | |
| 672. |
Which of the following is NOT included in the header of a function? |
| A. | the type of variable returned by the function to the function that calls it |
| B. | the name of the program or function that calls the function |
| C. | the name of the function |
| D. | the types and names of any variables that will be passed to the function |
| Answer» C. the name of the function | |
| 673. |
When a program calls a function that has default parameters, if you omit an argument, you must _____ |
| A. | not omit any other arguments |
| B. | omit all arguments |
| C. | omit all arguments to the right of that argument |
| D. | omit all arguments to the left of that argument |
| Answer» D. omit all arguments to the left of that argument | |
| 674. |
If an exception is thrown and no catch block matches the type of the thrown parameter, then _____ |
| A. | the program terminates |
| B. | the first catch block is executed |
| C. | the last catch block is executed |
| D. | the program proceeds with the code following the catch blocks |
| Answer» B. the first catch block is executed | |
| 675. |
If the description of function is "input the quantity, validate that the quantity is greater than 1, subtract 1 from the quantity, and print the quantity," the function is |
| A. | sequentially cohesive |
| B. | logically cohesive |
| C. | communicationally cohesive |
| D. | functionally cohesive |
| Answer» C. communicationally cohesive | |
| 676. |
If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as________ |
| A. | dynamic |
| B. | unary |
| C. | static |
| D. | volatile |
| Answer» D. volatile | |
| 677. |
You have assigned the address of Value to the pointer P, Which statement will display the value stored in Value? |
| A. | cout<<P; |
| B. | cout<<*Value; |
| C. | cout<<&P; |
| D. | cout<<*P; |
| Answer» E. | |
| 678. |
A constructor initialization list is preceded by |
| A. | a. semicolon |
| B. | a colon |
| C. | two colons |
| D. | a space |
| Answer» C. two colons | |
| 679. |
Each generic type in a template function definition is preceded by the keyword _________ |
| A. | template |
| B. | function |
| C. | type |
| D. | class |
| Answer» B. function | |
| 680. |
The declaration section holds |
| A. | data members |
| B. | data members and function prototypes |
| C. | data members, function prototypes, and the functions themselves |
| D. | None of the above |
| Answer» C. data members, function prototypes, and the functions themselves | |
| 681. |
A derived class _____ override attributes of a parent class |
| A. | may |
| B. | may if the two classes have the same name |
| C. | must |
| D. | must not |
| Answer» B. may if the two classes have the same name | |
| 682. |
Which functions do not have a this pointer? |
| A. | access functions |
| B. | inspector functions |
| C. | member functions |
| D. | static functions |
| Answer» E. | |
| 683. |
In object-oriented terms, an exception may be considered a(n) _____ |
| A. | child |
| B. | encapsulation |
| C. | message |
| D. | scalar type |
| Answer» D. scalar type | |
| 684. |
Which of the following statements creates a named constant called driverAge whose value is 16? |
| A. | const driverAge = 16; |
| B. | const short driverAge = 16; |
| C. | driverAge =16; |
| D. | driverAge const =16; |
| E. | namedconst driverAge =16; |
| Answer» C. driverAge =16; | |
| 685. |
The extraction operator >> is a(n) _____ |
| A. | overloaded function |
| B. | C++ class |
| C. | C++ object |
| D. | static reference variables |
| Answer» B. C++ class | |
| 686. |
Modules in C++ programs are |
| A. | functions |
| B. | procedures |
| C. | subroutines |
| D. | miniprograms |
| Answer» B. procedures | |
| 687. |
The return type for all destructors is |
| A. | the class |
| B. | void |
| C. | the same as the first data in the class |
| D. | None |
| Answer» E. | |
| 688. |
A function that changes an object's state belongs to the category of |
| A. | inspector functions |
| B. | mutator functions |
| C. | auxiliary functions |
| D. | manager functions |
| Answer» C. auxiliary functions | |
| 689. |
Which of the following pairs of identifier name(s) are(is) considered to be identical? |
| A. | name, names |
| B. | smith, johnsmith |
| C. | identifier 1, identifier_2 |
| D. | charl, char_l |
| E. | None of the above |
| Answer» D. charl, char_l | |
| 690. |
When you create a derived class and instantiate on object |
| A. | the parent class object must be constructed first |
| B. | the child class object must be constructed first |
| C. | the parent class object must not be constructed |
| D. | the child class object must not be constructed |
| Answer» B. the child class object must be constructed first | |
| 691. |
The int type of constants are whole numbers in the range |
| A. | - 23677 to 23678 |
| B. | - 32768 to 32767 |
| C. | - 32767 to 32768 |
| D. | - 32864 to 32865 |
| E. | None of the above |
| Answer» C. - 32767 to 32768 | |
| 692. |
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 | |
| 693. |
Which of the following statements will create and initialize a feelnfo array named fee? |
| A. | fee feeInfo = {{0}, {0}}; |
| B. | fee as feeInfo = 0, 0; |
| C. | feeInfo fee = 0, 0; |
| D. | feeInfo fee = [{0}, {0}]; |
| E. | feeInfo fee = {0,0}; |
| Answer» F. | |
| 694. |
Two or more arrays whose elements are related by their position (subscript) in the arrays are called _____ arrays |
| A. | horizontal |
| B. | paired |
| C. | parallel |
| D. | related |
| E. | vertical |
| Answer» D. related | |
| 695. |
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; |
| E. | both (a) and (d) |
| Answer» F. | |
| 696. |
The body of a C++ function is surrounded by _____ |
| A. | parentheses |
| B. | angle brackets |
| C. | curly brackets |
| D. | square brackets |
| Answer» D. square brackets | |
| 697. |
Which of the following type casts will convert an Integer variable named amount to a Double type? |
| A. | (double) amount |
| B. | (int to double) amount |
| C. | int to double(amount) |
| D. | int (amount) to double |
| Answer» B. (int to double) amount | |
| 698. |
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 | |
| 699. |
Which of the following operators is the equality operator? |
| A. | != |
| B. | = |
| C. | == |
| D. | ->> |
| E. | <> |
| Answer» D. ->> | |
| 700. |
In C++, you use _____ to perform standard input and output operations |
| A. | characters |
| B. | sequences |
| C. | streams |
| D. | tests |
| Answer» D. tests | |