COSC 93659

subject Type Homework Help
subject Pages 9
subject Words 1317
subject Authors Harvey Deitel, Paul Deitel

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
The argument list of a function call must match, or be consistent with, the
parameter list of the called function in all of the following details, except:
a. The number of arguments/parameters in the list.
b. The types of arguments/parameters in the list.
c. The names of arguments/parameters in the list.
d. The argument list and parameter list must match in all of the above details.
In a switch statement:
a. A break is required after each case.
b. Multiple actions in a case do not need to be enclosed in braces.
c. A default case is required.
d. A break is required after the default case.
When using exception handling, place any code that might throw an exception in a
__________.
a. catch block
page-pf2
b. try statement.
c. throw block.
d. what statement.
A member-function call can supply ________ that help the function perform its task.
a. parameters
b. arguments
c. classes
d. frameworks
Which of the following can have a pointer as an operand?
a. ++
b. *=
c. %
d . /
page-pf3
d. The UML models operations by listing the operation name preceded by an access
modifier. A(n) ________ indicates a public operation in the UML.
a. -
b. +
c. p
d. *
Pseudocode normally does not include:
a. Declarations.
b. Input/output.
c. Algorithms.
d. Control structures.
page-pf4
Each class you create becomes a new ________ you can use to declare variables and
create objects.
a. variable
b. object
c. type
d. access modifier
Which of the following statements is false?
a. The concepts of icons, menus and windows were originally developed by Xerox
PARC.
b. Windows is an open source operating system.
c. The software that contains the core components of the operating system is called the
kernel.
d. Linux source code is available to the public for examination and modification.
An example of a unary operator is:
a. The < relational operator.
page-pf5
b. The = assignment operator.
c. The % arithmetic operator.
d. The ! logical operator.
Which of the following is not included in <cmath>?
a. pow.
b. floor.
c. ln.
d. log.
A default constructor has how many parameters?
a. 0.
b. 1.
c. 2.
d. Variable number.
page-pf6
Which of the following statements is false?
a. An enumeration's constants have integer values.
b. An unscoped enum's underlying type is independent of its constants' values but is
guaranteed to be large enough to store those values.
c. A scoped enum's underlying integral type is int, but you can specify a different type
by following the type name with a colon (:) and the integral type. For example, we can
specify that the constants in the enum class Status should have type unsigned int, as
in enum class Status : unsigned int {CONTINUE, WON, LOST};
d. A compilation error occurs if an enum constant's value is outside the range that can
be represented by the enum's underlying type.
Which of the following statements is false?
a. Each class can define a constructor for custom object initialization.
b. A constructor is a special member function that must have the same name as the
class.
c. C++ requires a constructor call for every object that's created.
page-pf7
d. A constructor cannot specify parameters.
Which of the following is not a keyword that was added to C++ in the new C++11
standard?
a. nullptr.
b. operator.
c. constexpr.
d. noexcept.
C++ provides a number of features that 'spruce up" the C language, but more
importantly, it provides capabilities for ________ that were inspired by the Simula
simulation programming language.
a. structured programming
b. simulation
c. object-oriented programming
d. None of the above.
page-pf8
cin.getline(superstring, 30);
is equivalent to which of the following?
a. cin.getline(superstring, 30, '\0');
b. cin.getline(superstring, 30, '\n');
c. cin.getline(superstring, 30, '\s');
d. cin.getline(superstring, 30, '\t');
If a variable is declared in the initialization expression of a for statement, then:
a. It is automatically reinitialized to zero once the loop is finished.
b. The scope of the variable is restricted to that for loop.
c. It retains its final value after the loop is finished.
d. It can not be used in any structures that are nested in that for structure.
page-pf9
Which of the following is not true of pointers to functions?
a. They contain the starting address of the function code.
b. They are dereferenced in order to call the function.
c. They can be stored in arrays.
d. They can not be assigned to other function pointers.
Each of the following is a relational or equality operator except:
a. <=
b. =!
c. ==
d. >
Functions that are not members of a class are called ________ functions.
page-pfa
a. isolated
b. global
c. universal
d. general
An operator that associates from right to left is:
a. !=
b. ,
c. ()
d. ?:
Given that k is an integer array starting at location 2000, kPtr is a pointer to k and each
integer is stored in 4 bytes of memory, what location does kPtr + 3 point to?
a. 2003
b. 2006
c. 2012
page-pfb
d. 2024
________ models software in terms similar to those that people use to describe
real-world objects.
a. Object-oriented programming
b. Object-oriented design
c. Procedural programming
d. None of the above
Which of the following languages is used primarily for scientific and engineering
applications?
a. Fortran.
b. COBOL.
c. Pascal.
d. Basic.
page-pfc
[C++11]: Which of the following statements about pointer initialization and values is
false?
a. Prior C++11, the value specified for a null pointer was 0 or NULL.
b. When 0 is assigned to a pointer, it's converted to a pointer of the appropriate type.
c. The value 0 is the only integer value that can be assigned directly to a pointer variable
without first casting the integer to a pointer type.
d. In the new standard, you should use the constant null_ptr to initialize a pointer
instead of 0 or NULL.
If grade has the value of 60, what will the following code display?
if (grade >= 60) {
cout << "Passed";
}
a. nothing.
b. 60
c. Passed
d. cout << "Passed";
page-pfd
You can initialize fundamental-type data members in their declarations. This is known
as a(n) ________ initializer and was introduced in C++11.
a. explicit
b. implicit
c. global
d. in-class initializer
Assume that the array named items contains the integer values 0, 2, 4, 6 and 8. Which
of the following set of statements uses the range-based for loop to display each value in
items?
a. for (int i = 0; i <items.size(); ++i) {
cout <<items[i] <<endl;
}
b. for (int item : items) {
cout <<items[item] <<endl;
}
c. for (int item : items) {
cout <<item <<endl;
page-pfe
}
d. for (int item : items.size()){
cout <<item <<endl;
}
The inline keyword:
a. Increases function-call overhead.
b. Can reduce a function's execution time but increase program size.
c. Can decrease program size but increase the function's execution time.
d. Should be used with all frequently used functions.
An uninitialized local variable contains:
page-pff
a. The value last stored in the memory location reserved for that variable.
b. No value.
c. A value of zero.
d. A randomly assigned value.
Which of the following is not one the rules for forming structured programs?
a. Begin with the 'simplest activity diagram."
b. Any transition arrow can be reversed.
c. Any action state can be replaced by two action states in sequence.
d. Any action state can be replaced by any control statement.

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.