Question
C++ only Question 1 (1 point) Which of the following is not part of the Software Life Cycle? Question 1 options: Analysis Design Data Entry
C++ only
Question 1 (1 point)
Which of the following is not part of the Software Life Cycle?
Question 1 options:
Analysis | |
Design | |
Data Entry | |
Implementation | |
Testing |
Save
Question 2 (1 point)
One of the biggest difference between C and C++ is:
Question 2 options:
C is object-oriented | |
C++ is object-oriented | |
All C++ programs are also C programs | |
C only runs on UNIX computers |
Save
Question 3 (1 point)
The compiler will catch all your programming mistakes.
Question 3 options:
True | |
False |
Save
Question 4 (1 point)
The integer 0 is considered true.
Question 4 options:
True | |
False |
Save
Question 5 (1 point)
The stream that is used for input from the keyboard is called ___________.
_1_Question 5 options:
Save
Question 6 (1 point)
The stream that is used for output to the screen is called ___________.
_1_Question 6 options:
Save
Question 7 (1 point)
What is the value of x after the following statement?
float x;
x = 2.0 / 4.0 + (2 + 7) / 4
Question 7 options:
2.75 | |
2.5 | |
4.25 | |
2.0 |
Save
Question 8 (1 point)
What is the output after the following code executes? int x=10; if ( ++x > 10 ) { x = 13; } cout
Question 8 options:
10 | |
11 | |
13 | |
14 |
Save
Question 9 (1 point)
What is the output after the following code executes? int x=10; if ( x++ > 10 ) { x = 13; } cout
Question 9 options:
10 | |
11 | |
13 | |
14 |
Save
Question 10 (1 point)
What is the output of the following program segment? int x = 0; ++x; x++; ++x; x++; ++x; cout
Question 10 options:
0 | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 |
Save
Question 11 (1 point)
What is the value of the following expression?
(false || (4-3 && 6))
Question 11 options:
true | |
false | |
0 | |
illegal syntax |
Save
Question 12 (1 point)
if x is -1, what is the value of (!(x == 0))?
Question 12 options:
false | |
true | |
unable to determine | |
invalid syntax |
Save
Question 13 (1 point)
Given the following code, what is the final value of i at the end of the program?
int i; for(i=0; i
_1_Question 13 options:
Save
Question 14 (1 point)
pow(2,3) is the same as pow(3,2).
Question 14 options:
True | |
False |
Save
Question 15 (1 point)
Functions may have multiple return statements.
Question 15 options:
True | |
False |
Save
Question 16 (1 point)
The functions pow(), sqrt(), and fabs() are found in which include file?
Question 16 options:
cstdlib | |
cmath | |
iostream | |
regular |
Save
Question 17 (1 point)
What is the output of the following function call?
//function body
int factorial(int n)
{
int product=0;
while(n > 0)
{
product = product * n;
n;
}
return product;
}
//function call
cout
Question 17 options:
4 | |
0 | |
24 | |
48 |
Save
Question 18 (1 point)
What is decimal equivalent of the binary number 11011
Question 18 options:
Save
Question 19 (1 point)
What is the binary equivalent of the decimal number 39? (Don't include leading zeros)
Question 19 options:
Save
Question 20 (1 point)
Array can only store integers.
Question 20 options:
True | |
False |
Save
Question 21 (1 point)
The locations of the contents of an array can be spread out all over the memory.
Question 21 options:
True | |
False |
Save
Question 22 (1 point)
Arrays can be passed to functions.
Question 22 options:
True | |
False |
Save
Question 23 (1 point)
Which of the following function declarations correctly expect an array as the first argument?
Question 23 options:
void f1(int array, int size); | |
void f1(int& array, int size); | |
void f1(int array[100], int size); | |
void f1(float array[], int size); | |
All of the above | |
C and D | |
A and B |
Save
Question 24 (1 point)
Given the following array:
Position: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|---|
Value | 1 | 4 | 9 | 13 | 17 | 21 | 32 | 36 | 40 | 49 |
What is the POSITION of the first element encountered in a binary search for the value 19? Question 24 options:
Save
Question 25 (1 point)
Given the following array:
Position: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|---|
Value | 1 | 4 | 9 | 13 | 17 | 21 | 32 | 36 | 40 | 49 |
What is the POSITION of the second element encountered in a binary search for the value 19? Question 25 options:
Save
Question 26 (1 point)
Given the following array:
Position: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|---|---|---|---|---|---|---|---|---|---|
Value | 1 | 4 | 9 | 13 | 17 | 21 | 32 | 36 | 40 | 49 |
What is the POSITION of the third element encountered in a binary search for the value 19? Question 26 options:
Save
Question 27 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 1 pass of insertion sort into ascending order? Question 27 options:
10 20 50 40 30 | |
50 40 30 20 10 | |
10 20 30 50 40 | |
50 10 20 30 40 | |
10 20 50 30 40 | |
50 20 10 30 40 | |
20 50 10 30 40 | |
20 10 50 40 30 | |
10 20 30 40 50 |
Save
Question 28 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 2 passes of insertion sort into ascending order? Question 28 options:
10 20 50 30 40 | |
10 20 30 50 40 | |
50 10 20 30 40 | |
50 40 30 20 10 | |
50 20 10 30 40 | |
20 10 50 40 30 | |
20 50 10 30 40 | |
10 20 50 40 30 | |
10 20 30 40 50 |
Save
Question 29 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 3 passes of insertion sort into ascending order? Question 29 options:
10 20 50 40 30 | |
10 20 30 40 50 | |
50 10 20 30 40 | |
20 50 10 30 40 | |
50 40 30 20 10 | |
10 20 50 30 40 | |
10 20 30 50 40 | |
20 10 50 40 30 | |
50 20 10 30 40 |
Save
Question 30 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 4 passes of insertion sort into ascending order? Question 30 options:
50 20 10 30 40 | |
20 50 10 30 40 | |
10 20 50 30 40 | |
10 20 50 40 30 | |
10 20 30 40 50 | |
50 40 30 20 10 | |
20 10 50 40 30 | |
50 10 20 30 40 | |
10 20 30 50 40 |
Save
Question 31 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 1 pass of selection sort into ascending order? Question 31 options:
10 20 50 30 40 | |
50 20 10 30 40 | |
50 40 30 20 10 | |
10 20 30 50 40 | |
10 20 50 40 30 | |
20 50 10 30 40 | |
10 20 30 40 50 | |
20 10 50 40 30 | |
50 10 20 30 40 |
Save
Question 32 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 2 passes of selection sort into ascending order? Question 32 options:
50 20 10 30 40 | |
20 10 50 40 30 | |
20 50 10 30 40 | |
50 40 30 20 10 | |
50 10 20 30 40 | |
10 20 50 40 30 | |
10 20 30 50 40 | |
10 20 30 40 50 | |
10 20 50 30 40 |
Save
Question 33 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 3 passes of selection sort into ascending order? Question 33 options:
10 20 50 30 40 | |
50 10 20 30 40 | |
10 20 50 40 30 | |
10 20 30 50 40 | |
20 50 10 30 40 | |
50 20 10 30 40 | |
50 40 30 20 10 | |
20 10 50 40 30 | |
10 20 30 40 50 |
Save
Question 34 (1 point)
Given the following array values (as integers)
50 | 20 | 10 | 30 | 40 |
What will the array look like after 4 passes of selection sort into ascending order? Question 34 options:
50 20 10 30 40 | |
20 10 50 40 30 | |
10 20 30 40 50 | |
10 20 50 40 30 | |
10 20 30 50 40 | |
50 10 20 30 40 | |
10 20 50 30 40 | |
50 40 30 20 10 | |
20 50 10 30 40 |
Save
Question 35 (1 point)
Using the == operator on a string variable results in the same value as using strcmp on two c-strings.
Question 35 options:
True | |
False |
Save
Question 36 (1 point)
A string variable and a c-string are the same data type.
Question 36 options:
True | |
False |
Save
Question 37 (1 point)
To declare a c-string and initialize it to the value of "phonebook",
Question 37 options:
char s1=phonebook; | |
char s1[10]="phonebook"; | |
c-string phonebook; | |
char s1[10]=phonebook; |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started