The while loop is a(n) ________ loop and the do-while loop is a(n) ________ loop
ID: 3636012 • Letter: T
Question
The while loop is a(n) ________ loop and the do-while loop is a(n) ________ loop.
Question 1 answers
finite, infinite
infinite, finite
simple, complex
simple, complex
Question 2 text Question 2 3 points Save
What value will be assigned to the variable number by the following statement?
int number = 7.8;
Question 2 answers
7
8
7.8
It's unpredictable. That's the problem.
Question 3 text Question 3 3 points Save
#include <iostream> is an example of a(n) ________.
Question 3 answers
I/O statement
stream directive
preprocessor directive
compiler option
Question 4 text Question 4 3 points Save
In a function header, in addition to the name of the function, you are required to furnish ________.
Question 4 answers
a data type for each parameter
an identifier name for each parameter
the data type of the return value
All of the above
Question 5 text Question 5 3 points Save
When a function just needs to use a copy of an argument passed to it, the argument should normally be passed ________.
Question 5 answers
by variable
by value
by reference
as a default argument
Question 6 text Question 6 3 points Save
True/False: The following pair of C++ statements is legal.
const double taxRate;
taxRate = .05;
Question 6 answers
True
False
Question 7 text Question 7 3 points Save
A function can have zero to many parameters, and it can have ________ return value(s).
Question 7 answers
zero to many
either zero or one
either one or two
a maximum of ten
Question 8 text Question 8 3 points Save
A function other than the main function is executed ________.
Question 8 answers
when it is first defined
only once
whenever it is called
when the main function finishes executing
Question 9 text Question 9 3 points Save
Breaking a program up into a set of manageable sized functions is called ________ programming.
Question 9 answers
functional
modular
break up
high-level
Question 10 text Question 10 3 points Save
What will the following code print?
num = 8;
cout << --num << " ";
cout << num++ << " ";
cout << num;
Question 10 answers
7 7 8
7 8 8
8 7 7
8 7 8
Question 11 text Question 11 3 points Save
The following C++ statement will assign 1.5 to the result variable.
int result = 3.0 / 2.0;
Question 11 answers
True
False
Question 12 text Question 12 3 points Save
The ________ directive causes the contents of another file to be inserted into a program.
Question 12 answers
#getfile
#library
#include
use namespace std;
Question 13 text Question 13 3 points Save
When more than one function has the same name they are called parallel functions
Question 13 answers
True
False
Question 14 text Question 14 3 points Save
The value in ________ local variable is retained between function calls.
Question 14 answers
a global
an internal
a static
a dynamic
Question 15 text Question 15 3 points Save
What does the following C++ expression evaluate to?
6 - 6 / 3 + 3
Question 15 answers
0
1
3
7
Question 16 text Question 16 3 points Save
In C++, a value can be raised to a power by using ________.
Question 16 answers
the ^ operator
the exp operator
the power operator
the pow function
Question 17 text Question 17 3 points Save
When an array is passed to a function, it is actually ________ the array that is/are passed.
Question 17 answers
the starting memory address of
a copy of all the values in
the value stored in the first element of
the data type and size of
Question 18 text Question 18 3 points Save
The while loop has two important parts: a condition that is tested and a statement or block of statements that is ________.
Question 18 answers
repeated as long as the condition is true
repeated until the condition becomes true
done once if the condition is true
always done at least once, then repeated if the condition is true
Question 19 text Question 19 3 points Save
To check if a variable has a particular value, use the = relational operator, as in the statement
if (s = 3)
cout << "S has the value 3";
Question 19 answers
True
False
Question 20 text Question 20 3 points Save
The following C++ test checks if the variable child is in the range 3-12.
if (child >= 3 || child <= 12)
Question 20 answers
True
False
Question 21 text Question 21 3 points Save
If a C++ program contains the following array definition
int score[10];
the following statement would store 100 in the first array element
score[1] = 100;
Question 21 answers
True
False
Question 22 text Question 22 3 points Save
Every C++ program must have ________.
Question 22 answers
comments
variables
constants
a function called main.
Question 23 text Question 23 3 points Save
In a switch statement, each case must be which of the following?
Question 23 answers
An integer type
A constant
Not a user-defined value
All of the above
Question 24 text Question 24 3 points Save
________ causes a program to wait until information is typed at the keyboard and the Enter key is pressed.
Question 24 answers
An input device
The cin object
The cout object
A preprocessor
Question 25 text Question 25 3 points Save
A variable of the char data type holds a set of characters like "January".
Question 25 answers
True
False
Explanation / Answer
The while loop is a(n) ________ loop and the do-while loop is a(n) ________ loop.
simple, complex
What value will be assigned to the variable number by the following statement?
int number = 7.8;
7
#include <iostream> is an example of a(n) ________.
preprocessor directive
In a function header, in addition to the name of the function, you are required to furnish ________.
a data type for each parameter
an identifier name for each parameter
the data type of the return value
All of the above
When a function just needs to use a copy of an argument passed to it, the argument should normally be passed ________.
by value
True/False: The following pair of C++ statements is legal.
const double taxRate;
taxRate = .05;
False
A function can have zero to many parameters, and it can have ________ return value(s).
either zero or one
A function other than the main function is executed ________.
whenever it is called
Breaking a program up into a set of manageable sized functions is called ________ programming.
modular
What will the following code print?
num = 8;
cout << --num << " ";
cout << num++ << " ";
cout << num;
7 7 8
The following C++ statement will assign 1.5 to the result variable.
int result = 3.0 / 2.0;
False
The ________ directive causes the contents of another file to be inserted into a program.
#include
When more than one function has the same name they are called parallel functions
False
The value in ________ local variable is retained between function calls.
a static
What does the following C++ expression evaluate to?
6 - 6 / 3 + 3
7
In C++, a value can be raised to a power by using ________.
the pow function
When an array is passed to a function, it is actually ________ the array that is/are passed.
the starting memory address of
The while loop has two important parts: a condition that is tested and a statement or block of statements that is ________.
repeated as long as the condition is true
To check if a variable has a particular value, use the = relational operator, as in the statement
if (s = 3)
cout << "S has the value 3";
False
The following C++ test checks if the variable child is in the range 3-12.
if (child >= 3 || child <= 12)
False
If a C++ program contains the following array definition
int score[10];
the following statement would store 100 in the first array element
score[1] = 100;
True
Every C++ program must have ________.
a function called main.
In a switch statement, each case must be which of the following?
An integer type
________ causes a program to wait until information is typed at the keyboard and the Enter key is pressed.
The cin object
A variable of the char data type holds a set of characters like "January".
False
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.