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

Please answer all of the questions or the ones you have the answer too. No expla

ID: 3707717 • Letter: P

Question

Please answer all of the questions or the ones you have the answer too.
No explanation needed, just the answer.
Thank you!

Name: ID: A 23. Consider the following method definition. public static int strange (int[l liat, int listsize int item int count 0; it tlist[j] countt+ -item) return count Which of the following statements best describe the behavior ol a. This method returns the number of values stored in 1ist b. This method returns the sum of all the values of list c. This method returns the number of times item is stored in list d. This method this method can process an array of doubles 24. Given the following method heading public static void mystery(int listl, int size) and the declaration int alpha new int 751 Which of the following is a valid call to the method mystery? sterylalpha, 40) a. mystery lalpha 175], 501 b. mystery lalphai, 50) c. mys d. mystery (int I75!, alpha) Given the method heading public static void strange (int a, int b) and the declaration 25. int[] alpha new int 120] intll betanew int[251: Which of the following is a valid call to the method strange? a. strange (alpha I10], alpha [15]) b. strange (alpha [5], beta) c. strange (alpha(0j, beta [25]) d. strange (alpha, beta [201)

Explanation / Answer

23) c

we can see that the for loop is running until the end of the list and if the current element is equal to given item then we will increment the time

24)c

although the length we have passed as 40 instead of 75 the option c is the correct answer. we should directly give the array because we have already initialized it as an array type and the function is expecting an array type. The syntax of function call will not accept the braces[]. directly we have to give the array name

25) a&c

both the answers are correct. The function definition is expecting integers as input so if the function call contains either alpha or beta directly then the compiler will give type mismatch error. but the arrays are of type integers.so any specific index value will contain integers alone.So the alpha[number] or beta[any number] will be an integer.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote