Q.1

The process of extracting the relevant attributes of an object is known as

  • polymorphism
  • inheritance
  • abstraction
  • data hiding
Q.2

A C++ _____ is a program that runs in a DOS window

  • algorithm
  • cast application
  • console application
  • source application
Q.3

Evaluate the following expression: 4 >6 ||< 2 * 6

  • True
  • False
Q.4

The #ifndef directive tests to see whether ________

  • a class has been defined
  • a variable has been given a value
  • a class has no variable definitions
  • any objects of the class have been instantiated
Q.5

Which of the following is(are) invalid string constant(s)?

  • '7.15 pm'
  • "i like e"
  • "7.3el2"
  • "1234el2"
  • None of the above
Q.6

To be called object-oriented, a programming language must allow

  • functions that return only a single value
  • #include files
  • inheritance
  • All of the above
Q.7

The statement float values[]={3.-7.36.4.87};

  • assigns 36.96 to values[2]
  • assigns -7.86 to values[2]
  • gives an error message
  • assign 14 to values[2]
Q.8

A function stub typically contains

  • the function header
  • the function braces
  • the return statement, if it's value- returning function
  • a display message
  • All of the above
Q.9

Overloading involves writing two or more functions with ________

  • different names and different argument lists
  • different names and the same argument list
  • the same name and different argument lists
  • the same name and the same argument list
Q.10

The set of instructions for how to tie a bow is an example of the _____ structure

  • control
  • repetition
  • selection
  • sequence
  • switching
Q.11

The step-by-step instructions that solve a problem are called _____

  • an algorithm
  • a list
  • a plan
  • a sequential structure
Q.12

Which of the following statements is true?

  • Data coupling is tighter than pathological coupling
  • Common coupling is looser than data coupling
  • Data-structured coupling is looser than control coupling
  • Control coupling is looser than data coupling
Q.13

The operator that releases previously allocated memory is _____

  • release
  • return
  • delete
  • destroy
Q.14

In which statements, does a 'continue' statements cause the control to go directly to the test condition and then continue the looping process?

  • 'for' and 'while'
  • 'while' and 'if-else'
  • 'do-while' and 'if-else'
  • 'while' and 'do-while'
  • None of the above
Q.15

Sending a copy of data to a program module is called _______

  • passing a value
  • making a reference
  • recursion
  • setting a condition
Q.16

The best form of coupling is _____

  • complete
  • tight
  • loose
  • free
Q.17

A difference, between reference variables and pointers is that

  • reference variables are easier to use
  • pointers are easier to use
  • reference variables are more flexible
  • no difference exists between reference variables and pointers
Q.18

To expose a data member to the program, you must declare the data member in the _____ section of the class

  • common
  • exposed
  • public
  • unrestricted
  • user
Q.19

You can use C++ as a procedural, as well as an object-oriented, language

  • True
  • False
Q.20

Which of the following statements is false?

  • A function is a block of code that performs a specific task
  • Functions allow programmers to break large and complex problems into small and manageable tasks
  • Functions allow programmers to use existing code to perform common tasks
  • Functions can be called, or invoked, only once in a program
  • Programmer-defined functions can be either value-returning or void
Q.21

Evaluate the following expression: 7 >=3 + 4 || 6<4 && 2<5

  • True
  • False
Q.22

You define a structure type globally because _____

  • you save many lines of code by not rewriting an identical structure definition in each function that uses it
  • you will never change its definition
  • it is required in C++
  • All of the above
Q.23

A function that returns no values to the program that calls it is _____

  • not allowed in C++
  • type void
  • type empty
  • type barren
Q.24

A constructor initialization list is preceded by _____

  • a semicolon
  • a colon
  • two colons
  • a space
Q.25

A variable's _____ indicates which portions of the program can use the variable

  • area
  • extent
  • lifetime
  • reach
  • scope
Q.26

You___________overload function templates

  • may, as long as each version has the same arguments
  • may, as long as each version has different arguments
  • must
  • must not
Q.27

If no exception is thrown ________

  • a catch block will cause an error
  • the first catch block coded will execute
  • the last catch block coded with execute
  • any catch blocks coded with be bypassed
Q.28

The type to be used in an instantiation of a class template follows ________

  • the generic class name
  • the keyword template
  • the keyword class
  • the template definition
Q.29

Which of the following statements is false?

  • You typically use a public member function to change the value in a private data member
  • Because the constructor function does not return a value, you place the keyword void before the constructor's name
  • The public member functions in a class can be accessed by any program that uses an object created from that class
  • An instance of a class is considered an object
Q.30

Of the three ways to pass arguments to functions, only passing by _____ and passing by _____ allow the function to modify the argument in the calling program

  • reference, pointer
  • array, location
  • array, pointer
  • None of the above
Q.31

Paying attention to the important properties while ignoring inessential details is known as________

  • selectiveness
  • polymorphism
  • abstraction
  • summarizing
Q.32

A 'C function does not contain

  • a function header
  • argument declarations
  • other 'C' functions
  • function body
  • None of the above
Q.33

Evaluate the following expression: 3 >6&&7>4

  • True
  • False
Q.34

A default catch block catches

  • all thrown objects
  • no thrown objects
  • any thrown object that has not been caught by an earlier catch block
  • all thrown objects that have been caught by an earlier catch block
Q.35

Which of the following can be used to declare the main function?

  • void main
  • void Main()
  • void main()
  • main
  • either (b) or (c) can be used
Q.36

Which of the following statements uses the computer's clock to initialize the random number generator?

  • srand(time);
  • srand(time(NULL));
  • time(srand);
  • time(srand(NULL));
Q.37

In a class specifier, data or functions designated private are accessible

  • to any function in the program
  • only if you know the password
  • to member functions of that class
  • only to public members of the class
Q.38

The generic type in a template function

  • must be T
  • can be T
  • cannot be T for functions you create, but may be for C++'s built-in functions
  • cannot be T
Q.39

The base class for most stream classes is the _____ class

  • ios
  • out
  • in
  • app
Q.40

Overloaded functions are required to

  • have the same return type
  • have the same number of parameters
  • perform the same basic functions
  • None of the above
Q.41

The keyword used to define a structure is _____

  • stru
  • stt
  • struct
  • structure
Q.42

When the compiler places a copy of a small function's statements directly into a program, the function is said to be _____

  • overloaded
  • mangled
  • inline
  • redundant
Q.43

If an integer object is thrown with a throw statement, then a subsequent catch block has a usable match if the type of the catch argument is _____

  • const int &
  • int &
  • either (a) or (b)
  • neither (a) nor (b)
Q.44

You typically initialize Character variables to _____

  • a space enclosed in double quotes
  • a space enclosed in single quotes
  • the letter O
  • the number 0
  • the value false
Q.45

A program that predicts the exact sequence in which events will take place is said to be ________

  • compiled
  • interpreted
  • procedural
  • object-oriented
Q.46

Which of the following statements allows the user to enter data at the keyboard?

  • cin << currentPay;
  • cin >> currentPay;
  • cout << currentPay;
  • cout >> currentPay;
  • None of the above
Q.47

To use either an input or output file, the program must include the _____ header file

  • filestream.h
  • fstream.h
  • instream.h
  • inoutstream.h
  • iostream.h
Q.48

What does C++ append to the end of a string literal constant?

  • a space
  • a number sign (#)
  • an asterisk (*)
  • a null character
Q.49

When you omit parameters from a function call, values can be provided by

  • formal parameters
  • reference parameters
  • overloaded parameters
  • default parameters
Q.50

_____ variables remain in memory until the program ends

  • Area
  • Global
  • Local
  • Reference
  • Value
0 h : 0 m : 1 s