Q.1

Which of the following numerical value(s) is(are) invalid constant(s)?

  • 0.7
  • 9.3el2
  • 27,512
  • 12345678
  • None of the above
Q.2

The braces that surround the code in a 'C program

  • show what code goes in a particular function
  • delimit a section of code
  • separate the codes from the constant
  • separate the source file from the subject file
  • None of the above
Q.3

A comment

  • is a note that can be put into the source code
  • is ignored by the compiler.
  • starts with the /* character pair
  • All of the above
  • None of the above
Q.4

The keyword used to define a structure is

  • stru
  • stt
  • struct
  • unlimited
Q.5

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

  • setf()
  • bitsef()
  • ios()
  • flag()
Q.6

A class named Student must have a constructor whose name is

  • Student
  • ~Student
  • constructor
  • any legal C++ name
Q.7

The measure of how well the operations in a function relate to one another is _____

  • coupling
  • cohesion
  • adhesion
  • conversion
Q.8

Which of the following is NOT included in the header of a function?

  • the type of variable returned by the function to the function that calls it
  • the name of the program or function that calls the function
  • the name of the function
  • the types and names of any variables that will be passed to the function
Q.9

Which of the following is false?

  • You enclose a function's statements in a set of braces
  • The function header is considered a C++ statement, so it must end in a semicolon.
  • The keyword void tells the C++ compiler that the function does not return a value
  • A function can receive information that you send (pass) to it
  • An empty set of parentheses after the function's name in the function header tells you that the function does not receive any information
Q.10

The indirection operator is the

  • asterisk
  • ampersand
  • dollar sign
  • plus sign
Q.11

Which of the following is(are) valid identifier(s)?

  • record_1
  • 1 record
  • return
  • $tax
  • None of the above
Q.12

When two types are used in a function template and one is labeled T, the other

  • must also be named T
  • must be named U
  • can be any legal C++ identfier
  • it is illegal to have two types
Q.13

To write data that contains variables of type float, to an object of type ofstream, you should use

  • the insertion operator
  • seekg()
  • writeQ
  • put()
Q.14

If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as________

  • dynamic
  • unary
  • static
  • volatile
Q.15

A function's single most important role is to

  • give a name to a block of code
  • reduce program size
  • accept arguments and provide a return value
  • help organize a program into conceptual units
  • None of the above
Q.16

An address is a _____ , while a pointer is a _____

  • array, variable
  • constant, variable
  • variable, position
  • variable, location
Q.17

The actual arguments cannot he

  • a constant or a variable
  • of a different type from the corresponding formal arguments
  • other functions
  • expressions
  • None of the above
Q.18

A class hierarchy

  • describes "is a kind of" relationships
  • describes "has a" relationships
  • shows the same relationships as an organization chart
  • shows the same relationships as a family tree
Q.19

The _____ function returns the uppercase equivalent of a character

  • caseupper
  • charupper
  • toupper
  • uCase
  • upper
Q.20

Procedural cohesion is similar to sequential cohesion, except that with procedural cohesion _____

  • the tasks are not done in order
  • the tasks are simpler
  • the tasks share data
  • the tasks do not share data
Q.21

The statement double total = 0.performs _____

  • assignment
  • initialization
  • rationalization
  • polymorphism
Q.22

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

  • - 1
  • 0
  • 1
Q.23

Which of the following C++ expressions is equivalent to the mathematical expression 53 ?

  • 5 ^ 3
  • cube(5)
  • pow (3, 5)
  • pow(5, 3)
  • sqrt (5, 3)
Q.24

The best-written classes have

  • all functions private
  • all data public
  • no functions
  • None of the above
Q.25

When you instantiate a derived class object, a constructor for the derived class _____

  • is not called
  • is called prior to the base class constructor
  • is called simultaneously with the base class constructor
  • None of the above
Q.26

Typing the function's name as Main, rather than main, is an example of

  • an entry error
  • a function error
  • a logic error
  • a syntax error
Q.27

One drawback to returning an error code from a function is _____

  • functions cannot return error codes
  • error codes must be integers, and some functions can't return an integer
  • a function can return only one value, so it can return only the error code
  • a function that returns an error code will identify all returns as errors
Q.28

Recursive Functions

  • easier to code
  • executable faster than iterative ones
  • takes less main storage space
  • necessary to solve a certain class of problems
  • None of the above
Q.29

Which of the following creates an animal object named dog?

  • animal "dog";
  • animal dog;
  • dog "animal";
  • dog animal;
Q.30

The getline() function reads a line of text until _____

  • the length used as the second argument is reached
  • the character used as the third argument is reached
  • either (a) or (b)
  • neither (a) nor (b)
Q.31

The two parts of a function are the

  • header and footer
  • declarations and statements
  • legs and feet
  • header and body
Q.32

The general principle underlying object-oriented error handling is that a called function should __________

  • neither check for, nor handle errors
  • check for errors but not be required to handle any detected
  • handle errors, but not check for them
  • both check for and handle errors
Q.33

Which is true?

  • Coincidental cohesion is stronger than procedural cohesion
  • Logical cohesion is stronger than coincidental cohesion
  • Sequential cohesion is weaker than temporal cohesion
  • The weakest cohesion is functional
Q.34

A predefined function that may be used to handle memory allocation errors is

  • handle_error
  • set_new_handler
  • new_fix
  • memory_error
Q.35

The right shift operator is represented by the symbol

  • >
  • >>
  • ->
  • <
  • None of the above
Q.36

In C++, class definitions are most often

  • stored with each program that uses them
  • stored in a header file that is included in the programs that use them
  • stored in a folder that you paste into every new project
  • retyped for every new project
Q.37

Making class members inaccessible to nonmember functions is an example of

  • polymorphism
  • data hiding
  • redundancy
  • recursion
Q.38

Providing two or more constructors for the same class _____

  • requires different argument lists
  • requires different constructor names
  • requires different constructor types
  • is illegal
Q.39

A constructor may be _____

  • provided automatically by C++
  • written by you
  • either (a) or (b).
  • neither (a) nor (b).
Q.40

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

  • overloaded
  • destructed
  • ambiguous
  • dubious
Q.41

Assuming the following three operators appear in an expression (without parentheses), which of the operators will be performed first?

  • &&
  • !
  • ||
Q.42

The purpose of a conditional operator is to

  • select one of the two values
  • select the highest of the two values
  • select one of the two values depending on a condition
  • select the more equal of the two values
  • None of the above
Q.43

The extraction operator >> is a(n)

  • overloaded function
  • C++ class
  • C++ object
  • static reference variable
Q.44

Which of the following is false?

  • A void function's header begins with the keyword void
  • A value-returning function's header begins with a data type, which represents the type of data the function will return
  • Assuming displayAge is the name of a void function, displayAge(); is a both logically and syntactically valid C++ statement
  • Assuming calcNewPrice is the name of a value-returning function, calcNewPriceO; is a both logically and syntactically valid C++ statement
  • Both void and value-returning functions can receive arguments.
Q.45

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

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

3 is a _____ constant

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

Software that can be used in applications other than the one for which it was originally written is called

  • recyclable
  • inherited
  • reusable
  • cheating
Q.48

A function argument is

  • a variable in the function that receives a value from the calling program
  • a way that functions resist accepting the calling program's values
  • a value sent to the function by the calling program
  • a value returned by the function to the calling program
  • None of the above
Q.49

The code that you enter into a C++ program is called _____

  • console code
  • object code
  • project code
  • source code
Q.50

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

  • amt.Sold
  • amt-Sold
  • amt_Sold
  • 98Sold
  • None of the above are valid names for variables
0 h : 0 m : 1 s