Q.1

An expression

  • is a collection of data objects and operators that can be evaluated to a single value
  • is a name that substitutes for a sequence of characters
  • causes the computer to carry out some action
  • All of the above
  • None of the above
Q.2

Which of the following is false?

  • A pointer variable contains the address of a variable in memory
  • You should both declare and initialize a pointer before you use it
  • Pointers are typically initialized to the empty string ("")
  • A pointer's datatype must match the datatype of the variable to which it points
  • A pointer variable is typically referred to simply as a pointer
Q.3

The rules to any programming language are its _______

  • syntax
  • interpretation
  • logic
  • customs
Q.4

Which of the following is true?

  • iostream is derived from istream
  • iostream is derived from ostream
  • ostream is derived from iostream
  • ostream is derived from istream
Q.5

It is sometimes useful to specify a class from which no objects will ever be created

  • True
  • False
Q.6

The statement i*=3 is equivalent to

  • i = 3*
  • i = 3
  • i* = 3
  • i = i * 3
  • None of the above
Q.7

The two operators && an || are

  • arithmetic operators
  • equality operators
  • logical operators
  • relational operators
  • None of the above
Q.8

In the C language, the character type of constant is delimited by using

  • single quotes
  • double quotes
  • parenthesis
  • #
  • None of the above
Q.9

The function that takes arguments to set the bits of cout is _____

  • setf()
  • bitset()
  • ios()
  • flat()
Q.10

Which of the following backslash codes used for bell?

  • \b
  • a
  • \r
  • \s
  • None of the above
Q.11

The statement double val[15]={44.123456};

  • assigns the value 44.123456 to all members of the array val
  • assigns the value 44.123456 to val[0] and 0 to the rest of the members
  • gives an error message
  • assigns the value 44.12345 to val[1] and val[5]
Q.12

The number 125.is a _____

  • character literal constant
  • numeric literal constant
  • string literal constant
  • variable
Q.13

Which of the following declares and initializes an Integer variable named numltems?

  • int numltems = 0;
  • int numltems = '0';
  • integer numltems = 0;
  • numltems int = 0;
  • numltems integer = 0;
Q.14

The complement operator is represented by the symbol

  • ~
  • ^
  • i
  • <
  • None of the above
Q.15

The arguments that determine the state of the cout object are called _____

  • classes
  • manipulators
  • format flags
  • state controllers
Q.16

One way in which a structure differs from an array is that _____

  • a structure may have members of more than one type
  • a structure must have members that; are all the same type
  • art array may have members of more than one type
  • there is no difference between a structure and an array
Q.17

When you declare a pointer, you must give it a _____

  • type
  • type and name
  • type, name, and value
  • name and value
Q.18

The last statement in a value-returning function is always _____

  • };
  • result expression;
  • return;
  • return expression;
Q.19

Which of the following C++ expressions will find the square root of the number 16?

  • pow (16, 2) (b) root (16, 2)
  • sqroot (16)
  • sqrt (16, 2)
  • sqrt (16)
Q.20

When a class serves as a base class to others, _____

  • all of its members are inherited
  • all of its members are inherited, except for any private members
  • all of its members are inherited, except for any protected members
  • None of its members is inherited unless specifically "listed
Q.21

Which of the following tells C++ to display numbers in fixed notation?

  • setiosflags(fixed)
  • setiosflags(fixed: :is)
  • setiosflags(ios, fixed)
  • setiosflags(ios::fixed)
Q.22

One of the relational operators in the C language is

  • !=
  • &&
  • !
  • #
  • None of the above
Q.23

Static variables are sometimes called

  • class variables
  • functional variables
  • dynamic variables
  • auto variables
Q.24

A default constructor _____

  • takes no arguments
  • has default values for all its arguments
  • either (a) or (b)
  • neither (a) nor (b).
Q.25

You typically initialize Short Integer, Integer, and Long Integer variables to

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

One of the logical operators in the C language is represented by the symbol

  • AND
  • &&
  • >=
  • <=
  • None of the above
Q.27

It is illegal to make objects of one class members of another class

  • True
  • False
  • depends upon the kind of object
Q.28

Storing a class definition in a separate file is an example of

  • polymorphism
  • name mangling
  • implementation hiding
  • inheritance
Q.29

Which is true?

  • Sequential cohesion is slightly weaker than functional cohesion
  • Sequential cohesion is slightly stronger than functional cohesion
  • Sequential cohesion is much stronger than functional cohesion
  • Neither sequential cohesion nor functional cohesion is stronger than the other
Q.30

The #include instruction is called a

  • direction
  • directive
  • merge instruction
  • statement.
Q.31

Catch blocks must _____

  • appear in every object-oriented program
  • appear within try blocks
  • appear immediately after throw statements
  • appear immediately after try blocks
Q.32

A class named student must have a constructor whose name is

  • student
  • ~student
  • constructor
  • any legal C++ name.
Q.33

Another drawback to returning an error code from a function is that any error code returned by the function

  • must be of the same type as return type of the function
  • must not be a character
  • cannot be checked in a main() program
  • can have multiple meanings
Q.34

Classes hold _____

  • data
  • methods
  • both data and methods
  • neither data nor methods
Q.35

An exception specification begins with the keyword _____

  • exception
  • try
  • throw
  • catch
0 h : 0 m : 1 s