Numeric Grade: pts
1. Question :
(TCO 2) If firstName and lastName are string object variables,
which statement can be used to combine (append or
concatenate) the two into a single string variable?
Student Answer: fullName = firstName + lastName;
fullName = firstName, lastName;
fullName = firstName & lastName;
fullName = firstName && lastName;
Comments:
Question 2 Question :
. (TCO 2) What is the value of i after the following code fragment
executes?
int i = 2;
int k = 5 ;
i *= k + 1;
Student Answer: 7
11
12
14
Comments:
Question 3 Question :
. (TCO 2) C++ selection statements include:
Student Answer: for, while, do-while
cout and cin
if, if-else, if-else if, switch
#include <iostream> and using namespace std;
Comments:
, Question 4 Question :
. (TCO 2) Which of the following is not a C++ logical operator?
Student Answer: #
&&
„„
!
Comments:
Question 5 Question :
. (TCO 2) What is the result of 5 % 7?
Student Answer: 0
2
5
7
Comments:
Question 6 Question :
. (TCO 2) Given the following code to fill an array,
int X;
int data[100];
for(int i = 0; i <= X; i++)
data[i] = i;
What should the value of X be?
Student Answer: 100
101
99
i
Comments: