Accounting
Anthropology
Archaeology
Art History
Banking
Biology & Life Science
Business
Business Communication
Business Development
Business Ethics
Business Law
Chemistry
Communication
Computer Science
Counseling
Criminal Law
Curriculum & Instruction
Design
Earth Science
Economic
Education
Engineering
Finance
History & Theory
Humanities
Human Resource
International Business
Investments & Securities
Journalism
Law
Management
Marketing
Medicine
Medicine & Health Science
Nursing
Philosophy
Physic
Psychology
Real Estate
Science
Social Science
Sociology
Special Education
Speech
Visual Arts
Question
Which statement is true?a) With nested control statements, the inner control statement is executed in sequence after the outer control statement completes its own execution.
b) With nested control statements, the inner control statement is executed exactly once.
c) Experience has shown that the most difficult part of solving a problem on a computer is converting an already correct algoithm to a C program.
d) A double-selection statement can be nested in an iteration statement.
Answer
This answer is hidden. It contains 3 characters.
Related questions
Q:
Q1: Exception handling should not be used:
a. As an alternative for program control.
b. To make error handling uniform on large projects.
c. To deal with errors that do not arise very often.
d. To deal with errors for components that will be widely used in other applications, such as classes and libraries.
Q:
Q1: What will be output by the following statements?double x = .0012345;cout << fixed << x << endl;cout << scientific << x << endl;a. 1.234500e-0030.001235b. 1.23450e-0030.00123450c. .0012351.234500e-003d. 0.001234501.23450e-003
Q:
Q1: When the showbase flag is set:
a. The base of a number precedes it in brackets.
b. Decimal numbers are not output any differently.
c. "oct" or "hex" will be displayed in the output stream.
d. Octal numbers can appear in one of two ways.
Q:
Q1: Which of the following is not a member function of the C++ ostream class?
a. Stream-insertion operator (<<).
b. Stream-extraction operator (>>).
c. put.
d. write.
Q:
Q2: Which of the following is not an object of the ostream class?
a. cout
b. cerr
c. cin
d. clog
Q:
Q1: Which C++ data type was designed to store Unicode characters?
a. char
b. long
c. wchar_t
d. size_t
Q:
Q1: Select the correct statement regarding C++ I/O streams:
a. C++ provides only high-level I/O capabilities because it is a high-level programming language.
b. High-level (formatted) I/O is best for large-volume transfers.
c. Low-level I/O breaks information down into small, meaningful groups of related bytes.
d. Programmers generally prefer high-level I/O to low-level I/O.
Q:
Q4: Abstract classes do not necessarily have:
a. A 0 pointer in their vtable.
b. A virtual function prototype with the notation = 0.
c. Zero instances of their class.
d. Zero references to their class.
Q:
Q2: Concrete classes that inherit virtual functions but do not override their implementations:
a. Have vtables which are the same as those of their base classes.
b. Receive their own copies of the virtual functions.
c. Receive pointers to their base classes' virtual functions.
d. Receive pointers to pure virtual functions.
Q:
Q1: The line:
virtual double earnings() const = 0;
appears in a class definition. You cannot deduce that:
a. All classes that directly inherit from this class will override this method.
b. This class is an abstract class.
c. Any concrete class derived from this class will have an earnings function.
d. This class will probably be used as a base class for other classes.
Q:
Q4[C++11]: Which of the following statements is true?a. In C++11, all classes can be used as base classes.b. In C++11, only classes that are not declared as final can be used as base classes.c. In C++11, only classes that are declared as base can be used as base classes.d. None of the above
Q:
Q2: Which of the following is true about using inheritance in software engineering?
a. Common attributes and behaviors should be factored out of closely related classes and placed into a base class from which the original classes can now inherit.
b. It is best to create a huge class library to make it easy for a client to find the most appropriate class for his or her needs.
c. A class produced through inheritance should be as large as possible to fully encompass all of the functionality it should offer.
d. The standard C++ libraries that are shipped with C++ compilers are usually enough to accomplish anything an application might need to do.
Q:
Q3[C++11]: Which of the following statements about inheriting base class constructors is false?
a. To inherit a base class's constructors, you write the following line of code in the derived class definition (BaseClass is the base class's name):
using BaseClass::BaseClass;
b. If an inherited base-class constructor has default arguments, the line of code in Part (a) causes the compiler to generate a derived-class constructor with the same default arguments.
c. By default, each inherited constructor has the same access level (public, protected or private) as its corresponding base-class constructor.
d. If the derived class does not explicitly define constructors, the compiler generates a default constructor in the derived classeven if it inherits other constructors from its base class.
Q:
Q2: Which of the following is not a kind of inheritance in C++?a. public.b. private.c. static.d. protected.
Q:
Q3: Assume that the function call operator() is overloaded for data type String in the usual sense of selecting a substring from a larger string. For a String object string1 with the character string "ABCDEFGHI", what string does string1( 4 , 2 ) return?
a. "EF"
b. "EFGHI"
c. "CDEF"
d. "CD"
Q:
Q2: The array subscript operator [], when overloaded, cannot:
a. Be used with linked list classes.
b. Take a float as an operand.
c. Take multiple values inside (e.g., [4,8]).
d. Take user-defined objects as operands.
Q:
Q2: The delete [] operator:
a. Can terminate the program.
b. Must be told which destructor to call when destroying an object.
c. Can delete an entire array of objects declared using new.
d. Is called implicitly at the end of a program.
Q:
Q1: Suppose you have a programmer-defined data type Data and want to overload the << operator to output your data type to the screen in the form cout << dataToPrint; and allow cascaded function calls. The first line of the function definition would be:
a. ostream &operator<<( ostream &output, const Data &dataToPrint )
b. ostream operator<<( ostream &output, const Data &dataToPrint )
c. ostream &operator<<( const Data &dataToPrint, ostream &output )
d. ostream operator<<( const Data &dataToPrint, ostream &output )
Q:
Q4: y and z are user-defined objects and the += operator is an overloaded member function. The operator is overloaded such that y += z adds z and y, then stores the result in y. Which of the following expressions is always equivalent to y += z?a. y = y operator+= zb. y.operator+=(z)c. y = y + zd. y operator+=(y + z)
Q:
Q3: An overloaded + operator takes a class object and a double as operands. For it to be commutative (i.e., a + b and b + a both work):a. operator+ must be a member function of the class from which the objects are instantiated.b. operator+ must be a non-member function.c. It must be overloaded twice; the operator+ function that takes the object as the left operand must be a member function, and the other operator+ function must be a global function.d. The + operator cannot be overloaded to be commutative.
Q:
Q1: Which of the following is false?
a. A string can be defined to store any data type.
b. Class string provides bounds checking in its member function at.
c. Class string's overloaded [] operator returns a vector element as an rvalue or an lvalue, depending on the context.
d. An exception is thrown if the argument to string's at member function is an invalid subscript.
Q:
Q3: Assume that t is an object of class Test, which has member functions a(), b(), c() and d(). If the functions a(), b() and c() all return references to an object of class Test (using the dereferenced this pointer) and function d() returns void, which of the following statements will not produce a syntax error:
a. t.a().b().d();
b. a().b().t;
c. t.d().c();
d. t.a().t.d();
Q:
Q2: Which of the following statements about friend functions and friend classes is false?a. A class can either grant friendship to or take friendship from another class using the friend keyword.b. A friend declaration can appear anywhere in a class definition.c. A friend of a class can access all of its private data member and member functions.d. The friendship relationship is neither symmetric nor transitive.
Q:
Q2: A client changing the values of private data members is:
a. Only possible by calling private member functions.
b. Possible using public functions and references.
c. Never possible.
d. Only possible if the private variables are not declared inside the class.
Q:
Q2: Which of the following is not true of a destructor?
a. It performs termination housekeeping.
b. It is called before the system reclaims the object's memory.
c. If the programmer does not explicitly provide a destructor, the compiler creates an "empty" destructor.
d. It releases the object's memory.
Q:
Q2: Utility functions:
a. Are private member functions that support operations of the class's other member functions.
b. Are part of a class's interface.
c. Are intended to be used by clients of a class.
d. Are a type of constructor.
Q:
Q1: A function template can be overloaded by:
a. Using other function templates with the same function name and parameters.
b. Using non-template functions with the same name and different parameters.
c. Using non-template functions with a different name but the same parameters.
d. Using other function templates with a different name but the same parameters.
Q:
Q1: Which of the following is true?a. Only class templates may specify default type arguments for type parameters.b. Only function templates may specify default type arguments for type parameters.c. Both class templates and function templates may specify default type arguments for type parameters.d. None of the above.
Q:
Q1: Nontype parameters are:
a. Unable to have default arguments.
b. Specified before the angle-bracket-enclosed type-parameter list.
c. Constants.
d. Required for class templates.
Q:
Q3: Function templates:
a. Can include objects of template classes as parameters.
b. Must have return type T.
c. Do not need a separate template< typename type >statement if they take objects from a template class as a parameter.
d. Do not need a separate template< typename type >statement.