Q.1

An object is a(n) _____ of a class

  • owner
  • function
  • definition
  • instance
Q.2

The word case used in the switch statement represents a

  • function in the C++ language
  • data type in the C++ language
  • keyword in the C++ language
  • global variable in the C++ language
  • None of the above
Q.3

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

A member function uses the correct object when you call it because

  • a copy of the object is passed to the function
  • the address of the object is passed to the function
  • the address of the function is passed to another function
  • the address of the object is returned from the function
Q.5

The most common operation used in constructors is _____

  • addition
  • overloading
  • assignment
  • polymorphism
Q.6

_____ variables are declared outside of any statement block

  • Area
  • Global
  • Local
  • Reference
  • Value
Q.7

Function templates _____________

  • must have exactly one parameter
  • may have more than one parameter as long as they are of the same type
  • may have more than one parameter of any type
  • may not have parameters
Q.8

The C++ expression p --> val means the same thing as

  • *p.val
  • *(p.val)
  • (*p).vai
  • p.val
Q.9

Two access specifiers in C++ are

  • public and private
  • int and double
  • formal and informal
  • void and free
Q.10

When a function performs tasks based on a decision, it has _____

  • functional cohesion
  • coincidental cohesion
  • logical cohesion
  • no cohesion
Q.11

"Rohan Motors" is a _____

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

To use the this pointer with a member function, you _____

  • declare this as static
  • declare this as global
  • define this as equal to the address of the appropriate object
  • do nothing; it is automatically supplied for you
Q.13

A function that is called automatically each time an object is destroyed is a

  • constructor
  • destructor
  • destroyer
  • terminator
Q.14

The end of string is recognized by

  • the null character
  • the newline character
  • the $ sign
  • the / sign
  • None of the above
Q.15

The statement int num[2][3]={ {3,8,6}, {9,4,7}};

  • assigns a value 4 to num[1][2]
  • assigns a value 7 to num[1][2]
  • assigns a value 8 to num[1][2]
  • assigns a value 9 to num[1][2]
Q.16

Which of the following tells C++ to display numbers with zero decimal places?

  • setiosflags(0)
  • setiosflags(zero)
  • setprecision(0)
  • setprecision(zero)
Q.17

Which of the following is the fourth problem-solving step?

  • analyze the problem
  • evaluate and modify (if necessary) the program
  • code the algorithm
  • plan the algorithm
  • desk-check the program
Q.18

Which of the following are valid characters for a numeric literal constant?

  • a decimal point
  • the letter e
  • a minus sign
  • a plus sign
  • All of the above
Q.19

Which of the following statements opens a file named temp.dat for output?

  • outFile.open("temp .dat");
  • fileOut.output("temp .dat");
  • openFile.out("temp .dat");
  • fileOpen.out("temp .dat");
  • out.fileOpen("temp .dat");
Q.20

When the function char someFunction(int x) is executed,

  • it will throw nothing
  • it will throw an integer
  • it will throw a character
  • it may or may not throw anything
Q.21

A(n) _____ is a numeric variable used for counting something

  • accumulator
  • adder
  • constant
  • counter
  • integer
Q.22

To create a template class, you begin with _________

  • the template definition
  • the keyword class
  • the function definitions
  • the keyword definition
Q.23

Which of the following is a C++ object?

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

The logical NOT operator represented by is a

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

A programming structure that contains data and a pointer to the next object is a

  • template
  • class
  • pointer class
  • linked list
Q.26

A variable declared in a function is called a(n) _____ variable

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

A function that is prototype as int calculate(int num); may

  • receive an integer variable named num from the main() program
  • receive any integer variable from the main() program
  • either (a) or (b)
  • neither (a) nor (b)
Q.28

We can output text to an object of class ofstream using the insertion operator « because

  • the ofstream class is a stream
  • the insertion operator works with all classes
  • we are actually outputting to cout
  • the insertion operator is overloaded in ofstream
Q.29

Variable names known only to the procedure in which they are declared are ________

  • local
  • global
  • recent
  • internal
Q.30

Private data can be accessed by

  • class member functions
  • functions in derived classes
  • both (a) and (b)
  • neither (a) nor (b)
Q.31

Code that has already been tested is said to be _____

  • inherited
  • reusable
  • reliable
  • polymorphic
Q.32

Within parentheses, catch blocks can have _____

  • no arguments
  • one argument
  • two arguments
  • as many arguments as necessary
Q.33

Any #include files may contain

  • constants
  • variables
  • functions
  • All of the above
Q.34

Which of the following will store the letter H in a Character variable named initial?

  • initial = 'H'
  • initial = 'H';
  • initial = "H"
  • initial = "H";
Q.35

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
  • an array may have members of more than one type
  • there is no difference between a structure and an array
Q.36

Variables that hold memory addresses are called _____

  • subscripts
  • holders
  • pointers
  • indicators
Q.37

The element of an array is

  • the name of the array
  • a member of an array
  • a value assigned to an array
  • All of the above
Q.38

A variable is _____

  • an item of data
  • a memory location whose value can change while the program is running
  • a memory location whose value cannot change while the program is running
Q.39

When variables refer to attributes of an entity (such as name, address, and phone number of a person), those attributes form a _____

  • file
  • record
  • field
  • program
Q.40

When you write to a file rather than the screen, you use the C++ class _____

  • iostream
  • filed
  • fstream
  • diskclass
Q.41

A do-while loop contains

  • only one statement between the do statement and the while statement
  • several statements between the do statement and the while statement
  • no statement at all between the do statement and the while statement
  • only two statement between the do statement and the while statement
  • None of the above
Q.42

The operator that allocates new memory is _____

  • allocate
  • mem
  • new
  • next
Q.43

Whis is true?

  • A derived class may have more than one base class
  • A base class may have more than one derived class
  • both (a) and (b)
  • neither (a) nor (b)
Q.44

The store of memory available to programs is the _____

  • store
  • stack
  • pile
  • heap
Q.45

The while loop is referred to as a(n) _____ loop because the loop condition is tested at the beginning of the loop

  • beginning
  • initial
  • pretest
  • priming
Q.46

When a break statement is used in a loop, the control skips the rest of the statements in the loop after it and jumps

  • to the last lines in the program
  • to the next statement written after the body of the loop
  • to the first statement in the body of the loop
  • All. of the above
  • None of the above
Q.47

Compared with the classes from which they are derived, inherited classes may have _____

  • additional data members
  • additional member functions
  • both (a) and (b)
  • neither (a) nor (b)
Q.48

The general form of do-while statement is

  • do expression while statement;
  • do while expression;
  • do statement while (expression);
  • do statement while statement;
  • None of the above
Q.49

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

  • it will throw nothing
  • it may throw an integer
  • it may throw a character
  • it may not throw anything
Q.50

A derived class _____ override attributes of a parent class

  • may
  • may if the two classes have the same name
  • must
  • must not
0 h : 0 m : 1 s