Midterm Lab Exam - ComProg1
Midterm Lab Exam - ComProg1
Question 1
Correct
#include
int main ()
int n, result = 0;
result += array[n];
return 0;
}
a. 27
b. 26
c. 25
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 1/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 2
Correct
#include
int main()
return 0;
}
a. ABC
c. AB
d. ABCD
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 2/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 3
Correct
#include
<iostream>
#include
<string>
int
main()
{
cout<<is_array<int>::value;
cout<<is_array<char[10]>::value;
cout<<is_array<string>::value;
return 0;
a. 011
b. 110
c. 100
d. 010
Question 4
Correct
a. Programmer-defined
b. 0
c. 8
d. 9
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 3/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 5
Correct
do {
cout <<
"this is a loop" << endl;
x++;
}
a. 15,x
b. x, 16
c. x, 14
d. x,15
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 4/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 6
Correct
Fill in the blanks to enter five numbers from the user and
print their sum. Store the sum in the variable named total.
int x = 1;
int number;
int total = 0;
_______ (x <= 5) {
}
cout << "Sum: " << _____ <<
endl;
c. while, total,
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 5/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 7
Correct
}
______ {
a. if, x
b. if, else
c. if, then
d. else, if
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 6/7
11/16/22, 7:08 PM Midterm Lab Exam: Attempt review
Question 8
Correct
int x;
cin >> x;
switch (____) {
case 2:
cout <<
"it's 2" << endl;
break;
______:
cout <<
"the default case" << endl;
}
a. y, default
b. 2, default
d. x, default
◄ Midterm Exam
Jump to...
trimestralexam.amaesonline.com/2213/mod/quiz/review.php?attempt=124838&cmid=5217 7/7