Description of this paper

What is the value of data after the following code executes?

Description

solution


Question

Top of Form;Question 1. 1. (TCO 2) What is the value of data after the following code executes?;unsigned char data = 0xA5;data = data && 0xF0;(Points: 6);0xA0;0xF0;0xF5;0x5A;Question 2. 2. (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? (Points: 6);fullName = firstName + lastName;fullName = firstName, lastName;fullName = firstName && lastName;fullName = firstName &&& lastName;Question 3. 3. (TCO 2) For a switch statement, which of the following case statement expressions is invalid or logically incorrect? (Points: 6);case 1 < x < 100;case 'B'|'b;case a23.45;All of the above;Question 4. 4. (TCO 2) What output does the following code produce?;cout << fixed << setprecision(3);double pi = 3.14159;cout << pi << endl, (Points: 6);3.14159;3.142;3.14;none of the above;Question 5. 5. (TCO 2) What is the value of i after the following code fragment executes?;int i = 2;int k = 5;i *= k + 1, (Points: 6);7;11;12;14;Question 6. 6. (TCO 2) What is the data type of bullpen[3].era?;struct pitcher;string name;double era;pitcher p1;pitcher bullpen[10], (Points: 6);string;double;pitcher;const pointer to pitcher;Question 7. 7. (TCO 2) Given the following code fragment, what is the data type of roster[9].name?;struct student;string name;double gpa;student thisStudent;student roster[50], (Points: 6);string;const pointer to student;student;double;Question 8. 8. (TCO 2) Given the following code fragment, what is the data type of thisStudent?;struct student;string name;double gpa;student thisStudent, (Points: 6);string;const pointer to student;student;double;Question 9. 9. (TCO 2) Which of the following statements calls the following function correctly?;int MultiplyValues (int, int), (Points: 6);int a = MultiplyValues (int x, int y);int a = MultiplyValues (10, 20);double d = MultiplyValues (int 10, int 20);All of the above;Question 10. 10. (TCO 2) What is the output of the following code?;void func(int x[ ]);x[0] = x[0] * 3;x[1] = x[1] * 3;x[2] = x[2] * 3;int main ();int x[ ] = {1, 2, 3};func(x);cout << x[0] << " " << x[1] << " " << x[2] << endl;(Points: 6);1 2 3;3 4 5;3 6 9;3 3 3;Question 11. 11. (TCO 2) Which of the following function definitions uses pass-by-values? (Points: 6);int myFunc(int * x, int * y);int myFunc(int x, int y);int myFunc(int && x, int & y);int myFunc(int @value1, int @value2);Page 2;Question 1. 1. (TCO 2) How many parameters are required to overload the pre-increment operator for a class as a member function? (Points: 6);none;1;2;no limit;Question 2. 2. (TCO 2) What is the name of a member function of a class that only accesses the value(s) of member variable(s) and does not modify the value(s)? (Points: 6);Set;Private;Member;Accessor;Question 3. 3. (TCO 2) Which of the following is a valid declaration to overload the following function?;int whatever (double x), (Points: 6);double whatever (double x);int whatever (int x);int whatever2 (double x);int overload (double x);Question 4. 4. (TCO 2) Variables defined to be of a user-declared class are referred to as: (Points: 6);attributes;member variables;primitive variables

 

Paper#65102 | Written in 18-Jul-2015

Price : $21
SiteLock