CAS CS 73562

subject Type Homework Help
subject Pages 8
subject Words 64
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
A function prototype does not have to:
a. Include parameter names.
b. Terminate with a semicolon.
c. Agree with the function definition.
d. Match with all calls to the function.
Which of the following code segments prints a single line containing hello there with
the words separated by a single space?
a. std::cout << "hello ";
std::cout << " there";
b. std::cout << "hello" , " there";
c. std::cout << "hello";
std::cout << "there";
d. std::cout << "hello";
std::cout << " there";
page-pf2
Which of the following does the C++ compiler not examine in order to select the proper
overloaded function to call?
a. Types and order of the arguments in the function call.
b. The number of arguments in the function call.
c. The return type of the function.
d. It examines all of the above.
The ________ statement passes a value back to a function's caller.
a. recover
b. restore
c. pass
d. return
Which of the following is not a valid C++ identifier?
a. my Value
b. _AAA1
page-pf3
c. width
d. m_x
What will be the output after the following C++ statements have been executed?
int a{4};
int b{12};
int c{37};
int d{51};
if (a < b) {
cout << "a < b" << endl;
}
if (a > b) {
cout << "a > b" << endl;
}
if (d <= c) {
cout << "d <= c" << endl;
}
if (c != d) {
cout << "c != d" << endl;
}
a. a < b
page-pf4
c != d
b. a < b
d <= c
c != d
c. a > b
c != d
d. a < b
c < d
a != b
float and double variables should be used:
a. To perform monetary calculations.
b. As counters.
c. To store true/false values.
d. As approximate representations of decimal numbers.
page-pf5
Assuming the following pseudocode for the Fibonacci series, what is the value of the
5th Fibonacci number (fibonacci (5))?
fibonacci(0) = 0
fibonacci(1) = 1
fibonacci(n) = fibonacci(n " 1) + fibonacci(n " 2)
a. 1.
b. 3.
c. 5.
d. 7.
What does the following statement declare?
int *countPtr, count;
a. Two int variables.
b. One pointer to an int and one int variable.
c. Two pointers to ints.
d. The declaration is invalid.
page-pf6
Which of the following is most closely associated with Moore's Law?
a. Every year or two, the price of computers has approximately doubled.
b. Object-oriented programming uses less memory than previous software-development
methodologies.
c. Demand for communications bandwidth is decreasing dramatically each year.
d. Every year or two, the capacities of computers have approximately doubled without
any increase in price.
Which of the following uses C++11's list initialization to initialize count to 0?
a. int count = 0;
b. int count[0];
c. int count(0);
d. int count{0};
C++ is a(n) ________ programming language because you can define new class types
as needed.
a. strongly typed
page-pf7
b. extensible
c. inextensible
d. None of the above.
In a typical nested for loop (not a range-based for loop) used to process a
two-dimensional array, following the end of each execution of the inner for loop:
a. The outer for loop initializes its counter variable.
b. The outer for loop increments its counter variable.
c. The inner for loop initializes its counter variable.
d. The inner for loop increments its counter variable.
Which of the following statements is false?
a. The default constructor does not initialize the class's fundamental-type data members,
but does call the default constructor for each data member that's an object of another
class.
b. A string's default constructor initializes the object to the empty string.
c. An uninitialized fundamental-type variable is implicitly initialized to zero.
page-pf8
d. If a class defines a constructor, the compiler will not create a default constructor for
that class.
Labels are the only identifiers with:
a. Function scope.
b. File scope.
c. Block scope.
d. Function-prototype scope.

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.