Q.1

Reserving memory during program execution is known as reserving it

  • dynamically
  • statically
  • functionally
  • powerfully
Q.2

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

  • either (a) or (b)
  • a parent class of the thrown class
  • a child class of the thrown class
  • neither (a) nor (b)
Q.3

Assume that a program creates and initializes a Short Integer variable named age and a pointer named agePtr, to which it assigns the address of the age variable. Which of the following statements will assign the numberto the age variable?

  • age = 21;
  • *age = 21;
  • agePtr = 21;
  • *agePtr = 21;
  • both (a) and (d)
Q.4

Which of the following control structures is used in every program?

  • repetition
  • selection
  • sequence
  • switching
Q.5

The loosest type of coupling is

  • data coupling
  • control coupling
  • external coupling
  • pathological coupling
Q.6

You can pass _____ to functions

  • copies of individual structure members
  • copies of entire structures
  • pointers to structures
  • All of the above
Q.7

A function's purpose is to print customer data. Which of the following is the best name for this function?

  • pcd(). It's short for "print customer data" and takes few keystrokes
  • Printcustomerdata(). It states everything the function will do
  • printCustomer(). It states the function's purpose and is easy to read
  • lastFunction(). It is the final function called in most programs, and this name identifies the function's timing
Q.8

The declaration section holds

  • data members
  • data members and function prototypes
  • data members, function prototypes, and the functions themselves
  • None of the above
Q.9

Which of the following operators is the equality operator?

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

To create a variable, you must assign _____ to it

  • a data type
  • a name
  • both a data type and a name
  • the word var
Q.11

An identifier in C

  • is a name of a thing such as variable and function
  • is made up of letters, numerals, and the underscore
  • can contain both uppercase and lowercase letters
  • All of the above
  • None of the above
Q.12

A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies

  • accumulator, counter
  • counter, accumulator
Q.13

Which of the following pairs of identifier name(s) are(is) considered to be identical?

  • name, names
  • smith, johnsmith
  • identifier 1, identifier_2
  • charl, char_l
  • None of the above
Q.14

In C++, a function contained within a class is called

  • a member function
  • an operator
  • a class function
  • a method
Q.15

Which loop always processes its instructions at least once?

  • do-while
  • for
  • while
Q.16

The number of the relational operators in the C language is

  • four
  • six
  • three
  • one
  • None of the above
Q.17

Modules in C++ programs are

  • functions
  • procedures
  • subroutines
  • miniprograms
Q.18

The best functions have _____

  • high cohesion and tight coupling
  • high cohesion and loose coupling
  • low cohesion and tight coupling
  • low cohesion and loose coupling
Q.19

The weakest form of cohesion is

  • coincidental
  • functional
  • logical
  • communicational
Q.20

The statement fwrite ( (char*)&objl, sizeof(objl) );

  • writes the member functions of objl to fl
  • writes the data in objl to fl
  • writes the member functions and me data of obj 1 to fl
  • writes the address of objl to fl
Q.21

In the C language, a string is assigned to the

  • char type of variable
  • string type of variable
  • conversion specification %s
  • All of the above
Q.22

Which of the following is a string literal constant?

  • "Visual C++"
  • "137.45"
  • "A"
  • "2,365"
  • All of the above
Q.23

Variables that are known only to the function in which they are declared are called _____ variables

  • global
  • local
  • main
  • separate
  • void
Q.24

A function whose purpose is to send messages to other functions is known as a _____

  • dispatcher
  • courier
  • messenger
  • sender
Q.25

Element doubleArray[is which element of the array?

  • the sixth
  • the seventh
  • the eighth
  • impossible to tell
Q.26

The function strcmp("Jose", "JOSE") will return _____

  • - 1
  • 0
  • 1
Q.27

Which of the following assigns the number 5 to the area variable?

  • area 1 = 5
  • area = 5
  • area == 5
  • area --> 5
  • area < > 5
Q.28

When the compiler cannot differentiate between two overloaded constructors, they are called

  • overloaded
  • destructed
  • ambiguous
  • dubious
Q.29

The items listed in the function header are called _____

  • actual arguments
  • formal parameters
  • passed parameters
  • sent arguments
Q.30

A derived class _____ override attributes of a parent class

  • may
  • may if the two classes have the same name
  • must
  • must not
Q.31

In C++, you use _____ to perform standard input and output operations

  • characters
  • sequences
  • streams
  • tests
Q.32

You indicate a variable is a pointer variable by placing a(n) _____ in front of the variable's name

  • asterisk
  • ampersand
  • dollar sign
  • exclamation point
Q.33

Which of the following creates a String named constant called partNo, whose value is AB45?

  • const char[4] partNo = "AB45";
  • const char[5] partNo = 'AB45';
  • const char[5] partNo = "AB45";
  • const char partNo[5] = "AB45";
  • None of the above
Q.34

The C++ _____ function generates random numbers

  • generate()
  • genRand
  • rand
  • randGen
  • srand
Q.35

When you create a derived class and instantiate on 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.36

Which of the following statements will create and initialize a feelnfo array named fee?

  • fee feeInfo = {{0}, {0}};
  • fee as feeInfo = 0, 0;
  • feeInfo fee = 0, 0;
  • feeInfo fee = [{0}, {0}];
  • feeInfo fee = {0,0};
Q.37

When a new class is derived from an existing class, the derived class member functions _____ have names that differ from base class function names

  • may
  • may if the two classes have the same name
  • must
  • must not
Q.38

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

  • setdecimal(2)
  • setiosflags(2)
  • setiosflags(2.00)
  • setprecision(2)
Q.39

The return type for all destructors is

  • the class
  • void
  • the same as the first data in the class
  • None
Q.40

The 'continue' statement is used to

  • permit two different expressions to appear in situations where only one expression would ordinarily be used
  • terminate loops or to exit from a switch
  • alter the normal sequence of program execution by transferring control to some other part of the program
  • All of the above
  • None of the above
Q.41

The body of a C++ function is surrounded by _____

  • parentheses
  • angle brackets
  • curly brackets
  • square brackets
Q.42

The return type you code for all constructors is _____

  • void
  • the class type
  • the same type as the first data member defined in the class
  • no type
Q.43

When a language has the capability to produce new data types, it is said to be

  • reprehensible
  • encapsulated
  • overloaded
  • extensible
Q.44

Errors in a program are called

  • accidents
  • annoyances
  • bugs
  • mistakes
  • typing errors
Q.45

Which of the following statements declares a one-dimensional Character array named item that consists of five elements?

  • char item[0 to 4] = "";
  • char item[0 to 5] = "";
  • char item[4] = "";
  • char item[5] = "";
  • string item[5] = ' ';
Q.46

Which of the following, if any, are valid names for variables?

  • class
  • friend
  • #OnHand
  • void
  • None of the above are valid names for variables
Q.47

In the expression p --> val,p is a(n)

  • address
  • pointer
  • structure
  • header
Q.48

With commercial classes, the function source code is usually________

  • printed on high-quality paper
  • poorly written
  • provided on a disk
  • provided in object form
Q.49

A pointer to void can hold pointers to

  • char type
  • int type
  • float type
  • any data type
Q.50

A base class may also be called a

  • child class
  • subclass
  • derived class
  • parent class
0 h : 0 m : 1 s