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

____ 21. Which of the following statements has an error? a. int rent[4] = {250,

ID: 3918136 • Letter: #

Question

____ 21. Which of the following statements has an error? a. int rent[4] = {250, 375, 460, 600}; b. int rent[] = {250, 375, 460, 600}; c. int rent[4] = {250, 375}; d. int rent[4] = {250, 375, 460, 600, 650};  

  

  

____ 22. A convenient way to set all array elements to zero is to declare as follows: int rent[20] = ____;. a. 0 c. {0} b. {0..0} d. {}  

  

  

____ 23. An alternative to parallel arrays is to create ____. a. one-dimensional arrays c. arrays of structure objects b. two-dimensional arrays d. arrays of flag variables  

  

  

____ 24. The ____ of a variable defines where it can be accessed in a program. a. abstraction c. encapsulation b. scope d. lifetime  

  

  

____ 25. ____ variables are those that are known to all functions in a program. a. Global c. General b. Local d. Modular  

  

  

____ 26. A(n) ____ value is a value sent from a subfunction to the function that called it. a. return c. subroutine b. output d. function  

  

  

____ 27. A(n) ____ is the expression used within the parentheses when you call a function. a. value c. input b. argument d. prototype  

  

  

____ 28. An argument used in a function call is known as a(n) ____ parameter. a. execution c. formal b. actual d. call  

  

  

____ 29. The scope resolution operator is ____. a. & c. * b. :: d. ->  

  

  

____ 30. ____ variables are sometimes called class variables, class fields, or class-wide fields. a. Public c. Constant b. Private d. Static  

  

  

____ 31. The ____ pointer is automatically supplied every time you call a non-static member function of a class. a. this c. const b. super d. void  

  

  

____ 32. The variable ____ is an example of a correct use of the this pointer. a. *this.employeeIdNum c. *(this.employeeIdNum) b. (*this).employeeIdNum d. *(this).employeeIdNum  

  

  

____ 33. getName() is a typical example of a(n) ____ function. a. manager c. inspector b. auxiliary d. predicate  

  

  

____ 34. A ____ function has the same name as its class. a. constructor c. predicate b. manager d. mutator  

  

  

____ 35. The ____ directive means that you have reached the end of the block of code that you are defining. a. #define c. #ifdef b. #endif d. #ifndef  

Explanation / Answer

21) option d
int rent[4] = {250, 375, 460, 600, 650};  
here size is 4 but we are setting 5 variables.
22)option d
23) option b
two dimensional arrays are the alternative way for creating parallel arrays
24)scope
25)Global variables are the one which can be accessed throughout the program

26)return value
27)argument
28)actual parameters.
29):: is the scope resolution operator
30) Static . Variables declared with static keyword are called as static variables
31)this which represnts the currenst state of the class and by which we can access current obects variables
32) *(this.employeeIdNum)
33) auxiliary
34) constructor
35) #endif