Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the class Example2: What is the output? The value of x is: 0 The value

ID: 3693878 • Letter: C

Question

Consider the class Example2: What is the output? The value of x is: 0 The value of x is: 10 The value of x is: 40 The value of x is: 160 an error message, the value of e.x must be a string If we change the main program to: What is the output? The value of y is: 0 The value of y is: 10 The value of y is: 30 The value of y is: 40 The value of y is: 160 What is the problem with the following code fragment? There is a spelling error. There is a syntax error. "array" is a reserved word The for loop variable is invalid There is a reference outside the array None of the above. Which of the statements below is true for the following program? The program will compile and execute. Class B will be undefined. The program will result in compilation error because the line ObjA. show (); is ambiguous. There is a runtime error. A function that is defined in a class and typically can access the internal state of an object of that class to perform some operation is called An object A method A predefined function An external function In object oriented programming, data and the functions that operate on that data are combined into a single unit. Such a unit is called a Class Method Package Function Constructor Consider the following C++ program From the above program, the output will be c1 = 1 c2 = 1 c1 = 1 c2 = 2 c1 = 2 c2 = 1 c1 = 2 c2 = 2

Explanation / Answer

22. d.

23. b. Note that, you're trying to print y and not e.y.

24. f. Note that arry is not a reserved word.

25. a.

26. b. Object is a collection of variables, and the methods that operate on those variables.

27. a

28. b