Name CSC 111 Date: Quiz #5 Part I: Multiple choice: Write the one choice that be
ID: 3915134 • Letter: N
Question
Name CSC 111 Date: Quiz #5 Part I: Multiple choice: Write the one choice that best completes the statement or answers the question. MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) Arguments to functions always appear within 1) A) curly braces C) parentheses B) brackets D) quotation marks 2) When you invoke a function with a parameter, the value of the argument is passed to the 2) parameter. This is referred to as A) call by name C) call by reference B) call by value D) function invocation 3) If a parameter is a reference variable, this parameter becomes an alias for the original variable. This Is referred to as A) pass by reference C) function invocation B) pass by name D) pass by value 4) The actual parameters of a functionm A) true B) false 5) 5) What is the representation of the third element in an array called a? B) al3] A) a(2) C) a(3) D) al2] 6) When you pass an array to a function, the function receives 6) A) a copy of the array C) a copy of the first element B) the length of the array D) the reference of the array 7) The array index of the first element in an array is 0 7) A) true B) false 8) Suppose array a is int all 1,2,3), what is a[0l - al2]? ?) ? 8) A) 2 C)-1 D) -2 E) 1 declares an array of char 9) A) charlJ chars B) char charsl C) charl] char D) char charfl 10) If the address of an integer array IntArray is 32FO, what is the address of IntArray[51? A) 3304 B) 3305 C) 3220 D) 32F5 11) A call for the function with a void return type is always a statement it self, but a call for the function 11) with a non-void return type can be treated as either a statement or an expression A) true B) falseExplanation / Answer
Dear Student, please find the solutions below
1. Parenthesis . e.g foo(int a)
2.call by value.
e.g
int a =5;
foo(5)
3. Pass by reference
e.g
int a=5;
foo(&a);
4.True
e.g
foo(10,"Chegg",true);//function call
void foo(int a,String arr,boolean val);//prototype
5.a[2]. Because array index starts from 0.
6. It receives a copy of the array.
7. true.Because array index starts from 0.
8. a[0] = 1
a[2] = 3
So 1-3 = -2
9.char chars[];
10. 32f5
11. True. As its implicit.
Happy Learning :)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.