Which of the following is NOT included in the header of a function?
A. the type of variable returned by the function to the function that calls it
B. the name of the program or function that calls the function
C. the name of the function
D. the types and names of any variables that will be passed to the function
Select an option to see the answer and solution.
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________
A. dynamic
B. unary
C. static
D. volatile
Select an option to see the answer and solution.
The logical NOT operator represented by is a
A. unary operator
B. binary operator
C. ternary operator
D. octal operator
E. None of the above
Select an option to see the answer and solution.
When variables refer to attributes of an entity (such as name, address, and phone number of a person), those attributes form a _____
A. file
B. record
C. field
D. program
Select an option to see the answer and solution.
A derived class _____ override attributes of a parent class
A. may
B. may if the two classes have the same name
C. must
D. must not
Select an option to see the answer and solution.
Which of the following is false?
A. You enclose a function's statements in a set of braces
B. The function header is considered a C++ statement, so it must end in a semicolon
C. The keyword void tells the C++ compiler that the function does not return a value
D. A function can receive information that you send (pass) to it
E. An empty set of parentheses after the function's name in the function header tells you that the function does not receive any information
Select an option to see the answer and solution.
A function's single most important role is to
A. give a name to a block of code
B. reduce program size
C. accept arguments and provide a return value
D. help organize a program into conceptual units
E. None of the above
Select an option to see the answer and solution.
The delete operator returns ______ to the operating system
A. memory that is no longer needed
B. void
C. recycle bin
D. None of the above
Select an option to see the answer and solution.
The major advantage of data hiding is that _____
A. your programs can include more data
B. you no longer need functions
C. no one can ever use your data
D. your data will be used correctly
Select an option to see the answer and solution.
The letter V is a _____
A. character literal constant
B. numeric literal constant
C. string literal constant
D. variable
Select an option to see the answer and solution.
Separating parts of a program into units that remain unaffected by other parts of a program is the concept known as _____
A. intrusion
B. volatility
C. encapsulation
D. protection
Select an option to see the answer and solution.
A function whose purpose is to send messages to other functions is known as a _____
A. dispatcher
B. courier
C. messenger
D. sender
Select an option to see the answer and solution.
With commercial classes, the function source code is usually________
A. printed on high-quality paper
B. poorly written
C. provided on a disk
D. provided in object form
Select an option to see the answer and solution.
The type of value that a function sends back to the function that calls it is known as its _____
A. type
B. return value
C. reference data
D. sentinel
Select an option to see the answer and solution.
Assume that a program includes the short *agePtr = NULL; statement. The name of the pointer is _____
A. *agePtr
B. age*Ptr
C. agePtr
D. NULL
Select an option to see the answer and solution.
Which of the following are never inherited?
A. public data members
B. constructor functions
C. void functions
D. overloaded + operators
Select an option to see the answer and solution.
The expression c = i++ causes
A. the value of i assigned to c and then i incremented by 1
B. i to be incremented by 1 and then the value of i assigned to c
C. value of i assigned to c
D. i to be incremented by 1
E. None of the above
Select an option to see the answer and solution.
An identifier in C
A. is a name of a thing such as variable and function
B. is made up of letters, numerals and the underscore
C. can contain both uppercase and lowercase letters
D. All of the above
E. None of the above
Select an option to see the answer and solution.
Which of the following creates a String named constant called partNo, whose value is AB45?
A. const char[4] partNo = "AB45";
B. const char[5] partNo = 'AB45';
C. const char[5] partNo = "AB45";
D. const char partNo[5] = "AB45";
E. None of the above
Select an option to see the answer and solution.
The bitwise AND operator is represented by the symbol
A. ^
B. &
C. &&
D. >>
E. None of the above
Select an option to see the answer and solution.