A class named Student must have a constructor whose name is
A. Student
B. ~Student
C. constructor
D. any legal C++ name
Select an option to see the answer and solution.
To write data that contains variables of type float, to an object of type ofstream, you should use
A. the insertion operator
B. seekg()
C. writeQ
D. put()
Select an option to see the answer and solution.
The main difference in operation between an 'if statement and a 'while' statement is
A. the 'while' loop body is executed
B. the body of the 'while' statement may be executed many times, the body of the 'if statements only once
C. the conditional expression following the keyboard is evaluated differently
D. All of the above
E. None of the above
Select an option to see the answer and solution.
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_________
A. a parent class of the thrown class
B. a child class of the thrown class
C. either (a) or (b)
D. neither (a) nor (b)
Select an option to see the answer and solution.
The weakest form of cohesion is
A. coincidental
B. functional
C. logical
D. communicational
Select an option to see the answer and solution.
The 'continue' statement is used to
A. permit two different expressions to appear in situations where only one expression would ordinarily be used
B. terminate loops or to exit from a switch
C. alter the normal sequence of program execution by transferring control to some other part of the program
D. All of the above
E. None of the above
Select an option to see the answer and solution.
The 'break' statement is used to exist from
A. a do loop
B. a for loop
C. a switch statement
D. All of the above
E. None of the above
Select an option to see the answer and solution.
You have assigned the address of Value to the pointer P, Which statement will display the value stored in Value?
A. cout<<P;
B. cout<<*Value;
C. cout<<&P;
D. cout<<*P;
Select an option to see the answer and solution.
A constructor initialization list is preceded by
A. One semicolon
B. One colon
C. Two colons
D. One space
Select an option to see the answer and solution.
In C++, a function contained within a class is called
A. a member function
B. an operator
C. a class function
D. a method
Select an option to see the answer and solution.
Which of the following statements will create and initialize a feelnfo array named fee?
A. fee feeInfo = {{0}, {0}};
B. fee as feeInfo = 0, 0;
C. feeInfo fee = 0, 0;
D. feeInfo fee = [{0}, {0}];
E. feeInfo fee = {0,0};
Select an option to see the answer and solution.
Which of the following is the scope resolution operator?
Select an option to see the answer and solution.
If the description of function is "input the quantity, validate that the quantity is greater than 1, subtract 1 from the quantity and print the quantity," the function is
A. sequentially cohesive
B. logically cohesive
C. communicationally cohesive
D. functionally cohesive
Select an option to see the answer and solution.
A function that changes an object's state belongs to the category of
A. inspector functions
B. mutator functions
C. auxiliary functions
D. manager functions
Select an option to see the answer and solution.
Which of the following pairs of identifier name(s) are(is) considered to be identical?
A. name, names
B. smith, johnsmith
C. identifier 1, identifier_2
D. charl, char_l
E. None of the above
Select an option to see the answer and solution.
When you create a derived class and instantiate on object
A. the parent class object must be constructed first
B. the child class object must be constructed first
C. the parent class object must not be constructed
D. the child class object must not be constructed
Select an option to see the answer and solution.
The int type of constants are whole numbers in the range
A. -23677 to 23678
B. -32768 to 32767
C. -32767 to 32768
D. -32864 to 32865
E. None of the above
Select an option to see the answer and solution.
When the function char someFunction(int x) is executed,
A. it will throw nothing
B. it will throw an integer
C. it will throw a character
D. it may or may not throw anything
Select an option to see the answer and solution.
One way in which a structure differs from an array is that
A. a structure may have members of more than one type
B. a structure must have members that are all the same type
C. an array may have members of more than one type
D. there is no difference between a structure and an array
Select an option to see the answer and solution.
Variables that hold memory addresses are called _____
A. subscripts
B. holders
C. pointers
D. indicators
Select an option to see the answer and solution.