Q.1

Assume that a program contains a programmer-defined void function. When C++ encounters the function's closing brace (}), C++ returns to the statement _____

  • immediately above the statement that called the function
  • that called the function
  • immediately below the statement that called the function
Q.2

Which of the following is not a programming control structure?

  • repetition
  • selection
  • sequency
  • sorting
Q.3

A _____ is a single item of information about a person, place, or thing

  • data file
  • field
  • program file
  • record
Q.4

A major advantage of inheritance is

  • reducing the time it takes to create new objects
  • not having to think about how objects will be used
  • reducing the amount of memory required to execute a progrma
  • enabling people who have not studied programming to create useful applications
Q.5

The last statement in a function is often a(n) _____

  • return
  • goodbye
  • finish
  • endfunction
Q.6

To create and execute a C++ program, you need to have access to

  • a C++ compiler
  • a C++ translator
  • an object code editor
  • a text editor
  • both (a) and (d)
Q.7

If you omit any constructor argument when you instantiate an object, you must use default values______

  • for all parameters to the constructor
  • for all parameters to the right of the argument
  • for all parameters to the left of the argument
  • for no other parameters
Q.8

The loop condition in a flowchart is represented by a(n) _____

  • diamond
  • oval
  • parallelogram
  • rectangle
Q.9

Which of the following, if any, are invalid names for a variable?

  • bankAccountNumber
  • first_Name
  • doubleNumber
  • operator
  • All of the above are valid names for variables
Q.10

To use a template class member function, use the ________ with the instantiation

  • scope resolution operator
  • dot operator
  • class definition
  • keword template
Q.11

When a class is derived from another derived class, the newly derived class

  • may have more liberal access to a base class member than its immediate predecessor
  • may have the same type of access to a base class member as its immediate predecessor
  • may have more limited access to a base class member than its immediate predecessor
  • both (b) and (c)
Q.12

Which of the following are valid characters constants?

  • '\n'
  • '\\'
  • '\0'
  • All of the above
  • None of the above
Q.13

The most common operation used in constructors is

  • addition
  • overloading
  • assignment
  • polymorphism
Q.14

Inheritance occurs when a class adopts all the traits of _________

  • an object
  • a parent class
  • a variable
  • a function
Q.15

The bitwise OR operator is a

  • unary operator
  • binary operator
  • ternary operator
  • octal operator
  • None of the above
Q.16

Which (if any) of the following is NOT a programmer-defined type

  • an array
  • a structure
  • a class
  • All of the above are programmer-defined types
Q.17

When a variable exists or is accessible, it is said to be _____

  • immediate
  • in the path
  • available
  • in scope
Q.18

The feature that allows the same operations to be carried out differently depending on the object is _____

  • polymorphism
  • polygamy
  • inheritane
  • multitasking
Q.19

When the function int someFunction(char c) throw( ) is executed, _____

  • it can throw anything
  • it may throw an integer
  • it may throw a character
  • it may not throw anything
Q.20

The two statements that can be used to change the flow of control are

  • if and switch
  • if and while
  • switch and do-while
  • break and continue
  • None of the above
Q.21

Many programmers separate a class into two files: _____

  • one for the declarations and one for the implementations
  • one for the void functions and one for the other functions
  • one for the public data and one for the private data
  • one for the primary functions and one for the auxiliary functions
Q.22

Inheritance is the principle that

  • classes with the same name must be derived from one another
  • knowledge of a general category can be applied to more specific objects
  • C++ functions may be used only if they have logical predecessors
  • one function name may invoke different methods
Q.23

If you assign a default value to any variable in a function prototype's parameter list, then _____

  • all other parameters in the function prototype must have default values
  • all parameters to the right of that variable must have default values
  • all parameters to the left of that variable must have default values
  • no other parameters in that prototype can have default values
Q.24

The dot operator (or class member access operator) connects the following two entities (reading from left to right):

  • a class member and a class object
  • a class object and a class
  • a class and a member of that class
  • a class object and a member of that class
Q.25

With a template class, _____ type is generic

  • no
  • exactly one
  • at least one
  • at most one
Q.26

If you want to use a class to define objects in many different programs, you should define the class in a C++ _____ file

  • header
  • program
  • source
  • text
Q.27

In a simple 'if' statement with no 'else'. What happens if the condition following the 'if is false?

  • the program searches for the last else in the program
  • nothing
  • control 'falls through' to the statement following 'if
  • the body of the statement is executed
  • None of the above
Q.28

If two types of errors may be thrown, you should write _______

  • no catch blocks
  • one catch block with two arguments
  • two catch block-one with an argument, and one without
  • two catch blocks with one argument each
Q.29

Template classes that have already been written to perform common class tasks are called _____

  • container classes
  • receptacle classes
  • repository classes
  • alembic classes
Q.30

A class Stockltems has four data members and three function members. You defineobjects as members of the class. Which is true?

  • Only one copy of each of the tnree functions exists
  • Only one copy of each of the four data members exists
  • Both (a) and (b) are true
  • Neither (a) nor (b) is true
Q.31

The continue statement should be written only

  • in the body of a loop.
  • in the nested loops
  • outside the body of a loop
  • any where
  • None of the above
Q.32

Assume a program contains a void function named displayName, which requires no formal parameters. Which of the following is a correct function prototype for this function?

  • displayName;
  • displayName(void);
  • void displayName;
  • void displayName();
  • void displayName(none);
Q.33

Which of the following is a C++ class?

  • >>
  • read()
  • cin
  • iostream
Q.34

If p and q are assigned the values 2 and 3 respectively then the statement p = q++

  • gives an error message
  • assigns a value 4 to p
  • assigns a value 3 to p
  • assigns a value 5 to p
  • None of the above
Q.35

A file pointer always contains the address of the file

  • True
  • False
Q.36

You declare a function with a function _____, which is typically entered at the beginning of the program, below the #include directives

  • call
  • prototype declaration
  • definition
  • pointer
Q.37

Precedence determines which operator

  • is evaluated first
  • is most important
  • is fastest
  • operates on the largest number
  • None of the above
Q.38

Which of the following is the insertion operator?

  • >>
  • <<
  • //
  • /*
  • both (a) and (b)
Q.39

If no constructors can specified for a derived class, objects of the derived class will use the constructors in the base class

  • True
  • False
Q.40

The get() function returns _____

  • a character
  • void
  • a reference to the object that invoked it
  • a copy of the object that invoked it
Q.41

The most efficient data type for a variable that the numberis the _____ data type

  • Character
  • Double
  • Float
  • Long Integer
  • Short Integer
Q.42

The number 5.5e3 is a _____ constant

  • character literal
  • named literal
  • numeric literal
  • string literal
Q.43

The compiler determines the type used in a template function via ___________

  • the name of the function
  • the first variable declared within the function
  • the type of the argument passed to the function
  • the type of the value returned from the function
Q.44

Simple routines that programmers use as place holders while a system is being tested are called _____

  • stubs
  • stumps
  • holders
  • templates
Q.45

The variables declared in a statement block or listed in a function header's parameterlist are considered _____ variables

  • area
  • global
  • local
  • reference
  • value
Q.46

In C++, the address operator is the following symbol _____

  • >>
  • &
  • *
  • !
Q.47

Within a program, you can instantiate ________that have a class template type

  • classes
  • functions
  • parameters
  • objects
Q.48

Assume that a variable will need to store only integers in the range of 1 throughThe most efficient data type for the variable is _____

  • character
  • float
  • integer
  • long integer
  • short integer
Q.49

You construct a class in two sections, known as the _____

  • header and body
  • type and parameters
  • declaration and implementation
  • pointer and variable
Q.50

You can place function templates

  • at the end of main()
  • at the start of a program above main()
  • in two files-one for the definition and one for the function
  • any of the above
0 h : 0 m : 1 s