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

8. What is the return type of the method in the accompanying figure? a. c. b. d.

ID: 3762082 • Letter: 8

Question

8.

What is the return type of the method in the accompanying figure?

a.

c.

b.

d.

9.

Which of the following is a valid call to the method in the accompanying figure?

a.

b.

c.

d.

10.

Based on the code in the accompanying figure, what would be the output of the following statement?

System.out.println(secret(5, 7.0));

a.

b.

c.

d.

public int mystery(int x, int y)
{
    if (x >= y)
        return x - y;
    else
        return x + y;
}

11.

Based on the code in the accompanying figure, what would be the output of the following statement?

System.out.println(mystery(8,7));

a.

b.

c.

d.

int[] numList = new int[50];

for (int i = 0; i < 50; i++)
    numList[i] = 2 * i;

num[10] = -20;
num[30] = 8;

8.

What is the return type of the method in the accompanying figure?

a.

public

c.

void

b.

int

d.

double ABCD

9.

Which of the following is a valid call to the method in the accompanying figure?

a.

secret(5, 4.8);

b.

secret(int 5, double 4.8);

c.

secret(int x, double y);

d.

public static int secret(5, 4.8); ABCD

10.

Based on the code in the accompanying figure, what would be the output of the following statement?

System.out.println(secret(5, 7.0));

a.

5.0

b.

7.0

c.

2.0

d.

35.0

public int mystery(int x, int y)
{
    if (x >= y)
        return x - y;
    else
        return x + y;
}

ABCD

11.

Based on the code in the accompanying figure, what would be the output of the following statement?

System.out.println(mystery(8,7));

a.

1

b.

7

c.

8

d.

15

int[] numList = new int[50];

for (int i = 0; i < 50; i++)
    numList[i] = 2 * i;

num[10] = -20;
num[30] = 8;

Explanation / Answer

8.

Figure is not given

9.

a.
secret(5, 4.8);
Other options has data types mentioned while invoking functions, which is not valid

10.
Code of secret is not mentioned

11.
a. 1 ( 8 - 7 since 8 is greater than 7)
      

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