Q.1

Some Streams work with input, and some with output

  • True
  • False
Q.2

A translator that notes whether you have used a language correctly may be called a _____

  • theasurus
  • compiler
  • coder
  • decoder
Q.3

In object-oriented terms, an exception may be considered a(n) _____

  • child
  • encapsulation
  • message
  • scalar type
Q.4

Values that are used to end loops are referred to as _____ values

  • end
  • finish
  • sentinel
  • stop
Q.5

A function can make_________

  • one throw
  • one throw of each scalar type
  • one throw of each programmer-defined type
  • as many throws of as many types as necessary
Q.6

The bitwise AND operator is represented by the symbol

  • ^
  • &
  • &&
  • >>
  • None of the above
Q.7

The int type of constants are whole numbers in the range

  • - 23677 to 23678
  • - 32768 to 32767
  • - 32767 to 32768
  • - 32864 to 32865
  • None of the above
Q.8

Which of the following is the scope resolution operator?

  • ->>
  • ::
  • *
  • &
Q.9

The 'break' statement is used to exist from

  • a do loop
  • a for loop
  • a switch statement
  • All of the above
  • None of the above
Q.10

Which of the following type casts will convert an Integer variable named amount to a Double type?

  • (double) amount
  • (int to double) amount
  • int to double(amount)
  • int (amount) to double
Q.11

When an object-oriented program detects an error within a function, the function _________

  • throws an exception
  • throws a fit
  • catches a message
  • catches an exception
Q.12

A compound statement does not consist of

  • a single statement
  • other compound statements
  • expression statements
  • control statements
  • None of the above
Q.13

If you declare two objects as Customer firstCust, secondCust; which of the following must be true?

  • Each object's nonstatic data members will be stored in the same memory location
  • Each object will be stored in the same memory location
  • Each object will have a unique memory address
  • You cannot declare two objects of the same class
Q.14

A constructor always has

  • communicational cohesion
  • temporal cohesion
  • logical cohesion
  • no cohesion
Q.15

A derived class may also be called a

  • subclass
  • super class
  • parent class
  • derived class
Q.16

A child class _____ exist if there is no parent class

  • must
  • may
  • cannot
  • can
Q.17

In a template function, _____ argument is generic, or parameterized

  • no
  • exactly one
  • at least one
  • more than one
Q.18

The type of value that a function sends back to the function that calls it is known as its _____

  • type
  • return value
  • reference data
  • sentinel
Q.19

Which of the following is the extraction operator?

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

The _____ mode tells C++ to open a file for input

  • add::ios
  • in::file
  • ios::app
  • ios::in
  • ios::out
Q.21

If you design a class that needs special initialization tasks, you will want to design a(n) _____

  • housekeeping routine
  • initializer
  • constructor
  • compiler
Q.22

The feature in object-oriented programming that allows the same operation to be carried out differently, depending on the object, is_____

  • inheritance
  • polymorphism
  • overfunctioning
  • overriding
Q.23

Which of the following flowchart symbols represents the if selection structure?

  • diamond
  • hexagon
  • oval
  • parallelogram
  • rectangle
Q.24

A default exception block must be placed _____

  • first among the catch blocks
  • last among the catch blocks
  • globally, at the top of the file
  • at the end of all code in the program
Q.25

The exclusive OR operator gives the result 1 when

  • both the bits are 0
  • one bit is 0 and the other is 1
  • both the bits are 1
  • no hard and fast rule
  • None of the above
Q.26

Using a statement at the wrong time or with an inappropriate object creates a

  • logical error
  • syntax error
  • compiler error
  • language error
Q.27

The outline or the definition of a function is called its

  • beta test
  • forerunner
  • outline
  • prototype
Q.28

Which of the following statements will display the word "Hello" on the computer screen?

  • cin << "Hello";
  • cin >> "Hello";
  • cout << "Hello";
  • cout >> "Hello";
  • None of the above
Q.29

Which of the following is the inequality operator?

  • !=
  • =
  • ==
  • -->
  • <>
Q.30

A normal C++ operator that acts in special ways on newly defined data types is said to be

  • glorified
  • encapsulated
  • classified
  • overloaded
Q.31

The main() function is always

  • a called function
  • a calling function
  • recursive function
  • used at the end of the program
  • None of the above
Q.32

Object-oriented programmers primarily focus on _________

  • procedures to be performed
  • the step-by-step statements needed to solve a problem
  • objects and the tasks that must be performed with those objects
  • the physical orientation of objects within a program
Q.33

Assume that a program includes the short *agePtr = NULL; statement. The name of the pointer is _____

  • *agePtr
  • agePtr
Q.34

The function whose prototype is void getData(Item &thing); receives

  • a pointer to a structure
  • a reference to a structure
  • a copy of a structure
  • nothing
Q.35

Using the wardrobe structure within the ShopList structure is an example of a good programming principle, known as _____

  • reusability
  • polymorphism
  • redundancy
  • recursion
Q.36

Which type of statement does not occur in computer programs?

  • sequence
  • loop
  • denial
  • selection
Q.37

When an argument is passed by reference,

  • a variable is created in the function to hold the argument's value
  • the function cannot access the argument's value
  • a temporary variable is created in the calling program to hold the argument's value
  • the function accesses the argument's original value in the calling program
  • None of the above
Q.38

To send output to a file, you need to include the _____ header file in your program

  • file.h
  • fstream.h
  • iomanip.h
  • iostream.h
  • of stream.h
Q.39

When you create a derived class and instantiate an object _____

  • the parent class object must be constructed first
  • the child class object must be constructed first
  • the parent class object must not be constructed
  • the child class object must not be constructed
Q.40

A function can

  • return a value
  • perform a task
  • change value of actual arguments in call by reference
  • a, b, c above are all true
  • None of the above
Q.41

Which of the following is false?

  • Data stored in an array can be accessed faster than data stored in a disk file
  • Data stored in an array needs to be entered only once, typically at the beginning of the program
  • Arrays allow the programmer to store information in the computer's internal memory
  • When using arrays, you will have fewer variable names to remember
  • None of the preceding statements are false
Q.42

The prototype for a derived class constructor may include arguments for

  • data members of the derived class
  • data members of the base class
  • both (a) and (b)
  • neither (a) nor (b)
Q.43

You typically initialize a String variable to _____

  • an asterisk
  • a space enclosed in single quotes
  • the number 0
  • a zero-length string
Q.44

If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then

  • you must precede each function call with the word int or double
  • once a function is used as one type, it becomes unavailable for use with the other type
  • there is no difference in the procedure to call a member function
  • you cannot perform this operation in C++
Q.45

The preprocessor directive always starts with the symbol

  • %
  • &
  • #
  • ""
  • None of the above
Q.46

If a derived class uses the public access specifier, then _____

  • public base class members remain public in the derived class
  • protected base class members become public in the derived class
  • both (a) and (b)
  • neither (a) nor (b)
Q.47

A function in a derived class that has the same name as a function in the parent class

  • will override the base class function
  • will cause an error message to display
  • will be overridden by the base class function
  • will execute immediately often the base class function executes
Q.48

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.49

Which of the following are never inherited?

  • public data members
  • constructor functions
  • void functions
  • overloaded + operators
Q.50

The newline character is always included between

  • pair of parentheses
  • pair of curly braces
  • control string
  • &
  • None of the above
0 h : 0 m : 1 s