1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
djyliett [7]
3 years ago
8

For each call to the following method, indicate what console output is produced:public void mysteryXY(int x, int y) { if (y == 1

) { System.out.print(x); } else { System.out.print(x * y + ", "); mysteryXY(x, y - 1); System.out.print(", " + x * y); }} mysteryXY(4, 1); mysteryXY(4, 2); mysteryXY(8, 2); mysteryXY(4, 3); mysteryXY(3, 4);
Mathematics
1 answer:
soldi70 [24.7K]3 years ago
3 0

Answer:

1. mysteryXY(4, 1); = 4

2. mysteryXY(4, 2); = 8, ,4

3. mysteryXY(8, 2); = 16, , 8

4. mysteryXY(4, 3); = 12, , 8

5. mysteryXY(3, 4); = 12, , 9

Step-by-step explanation:

public void mysteryXY(int x, int y) {

if (y == 1) {

System.out.print(x);

}

else

{

System.out.print(x * y + ", ");

mysteryXY(x, y - 1);

System.out.print(", " + x * y); }

}

mysteryXY(4, 1); = 4

On line 2, the value of Y is tested;

Y = 1. So the operation on line 3 will be executed.

The values of X will be printed

X= 1

For question 2 through 5, the value of Y is not 1, so it'll skip line and jump to 6.

The statement on line 6 print x * y appended with a comma

On line 7, the values of y is reduced by 1

On line 8, it prints , and the result of x * y.

So, we have

2. mysteryXY(4, 2); = 8, ,4

4 * 2 = 8

Reduce y by 1

Then, 4 * 1 = 4

Output: 8, , 4

Applying the same logic to 3 to 5

3. mysteryXY(8, 2); =

Output: 16, , 8

4. mysteryXY(4, 3); =

Output: 12, , 8

5. mysteryXY(3, 4); =

Output: 12, , 9

You might be interested in
PLEASE, PLEASE HELP WITH THIS SOON!
levacccp [35]

Answer:

12.08

Trust me

5 0
3 years ago
Read 2 more answers
What number has 7 ten thousands, 1 thousand, 1 hundred, and no ones?
FrozenT [24]

Answer:

71,100

Step-by-step explanation:

If you are trying to find a number that is written in word form, we can just use place values to find what goes where.

A number is broken down into this:

Ten thousands, thousands, hundreds, tens, ones.

If they have 7 ten thousands, the first digit will be a 7.

If they have 1 thousand, the second digit will be a 1.

If they have 1 hundred, the third digit will be a 1.

Since nothing is stated about tens, we assume it's value is 0.

And since there are no ones, it's value is 0.

So:

71,100.

Hope this helped!

8 0
4 years ago
The base of an aquarium with given volume is made of slate and the sides are made of glass. If slate costs five times as much (p
crimeas [40]

Answer:

Base = Length = (2V/5)^⅓

Height = V^⅓/(2/5)^⅔

Step-by-step explanation:

Let the sides of the aquarium be l,b and h

Where l = length

b = base

h = height

Volume = lbh

V = lbh

The surface area of the box is

A = 2bh + 2lh + 2lb

We'll replace the 2lb with 5lb to get the cost of area because it's given the question that the slate (base) of the box cost 5 times as much per unit area as glass

C(l,b,h) = 2bh + 2lh + 5lb

Make h the subject of formula in (V = lbh)

h = V/lb

This will enable us to account for the lowest cost of materials by taking derivatives of the cost equation, and we need to solve for a l to put into the solution.

Substitute V/lb for h in the cost equation

C(l,b,V/lb) = 2b(V/lb) + 2l(V/lb) + 5lb ------ Simplify

C(l,b,V/lb) = 2V/l + 2V/b + 5lb

Take the derivatives of the above with respect to l and b

Cl = -2V/l² + 5b

Cb = -2V/b² + 5l

Equate Cb to Cl (this implies that b = l)

Cb = Cl =>

-2V/l² + 5b = -2V/b² + 5l

So, we have

C(b,b) = -2V/b² + 5b = 0

-2V/b² + 5b = 0 ---- Solve for b

-2V/b² = -5b ---- Multiply through by b²

-2V = -5b³ ---- Divide through by -5

2V/5 = b³ ---; Rearrange

b³ = 2V/5

b = (2V/5)^⅓

b = l

So, l = (2V/5)^⅓

h = V/lb ---- (b = l)

h = V/l² ---- Substitute (2V/5)^⅓ for l

h = V/((2V/5)^⅓)²

h = V/(2V/5)^⅔

h = V/((V^⅔)(2/5)^⅔)

h = V^⅓/(2/5)^⅔

5 0
3 years ago
24. Use the intercepts to graph the equation.
romanna [79]

Answer:

See below ~

Step-by-step explanation:

<u>Finding x-intercept</u>

  • Take y = 0
  • 2x - 5(0) = 10
  • 2x = 10
  • x = 5
  • x-intercept is at (5, 0)

<u>Finding y-intercept</u>

  • Take x = 0
  • 2(0) - 5y = 10
  • -5y = 10
  • y = -2
  • y-intercept is at (0, -2)

<u>Graph (with points marked)</u>

5 0
2 years ago
Read 2 more answers
6 divided by 2 times 200 multiplied by 5
kari74 [83]
6/2 = 3

3 x 200 = 600

600 x 5 = 3,000

3000 is your answer

hope this helps
6 0
3 years ago
Read 2 more answers
Other questions:
  • A company that makes boxes finds out that 3 out of the 20 boxes are damaged. What percent of the boxes are damaged?
    10·1 answer
  • Grant has 2 over 3 cup of ice cream in a bowl. He then removes two 1 over 6 cups of ice cream to share with his little brother.
    12·2 answers
  • A manufacturer of banana chips would like to know whether its bag filling machine works correctly at the 447 gram setting. It is
    10·1 answer
  • The ratio of cats to dogs in a park is 3 to 4
    14·2 answers
  • Kailey wrote 8,912,000 in scientific notation as 83.12*10 . Which statement best describes Kailey’s work?
    10·2 answers
  • What number is 100, zero zero zero, zero zero zero more than 5, 438, 724, zero 22
    14·1 answer
  • 50 POINT QUESTION!! A person is watching a boat from the top of a lighthouse. The boat is approaching the lighthouse directly. W
    10·1 answer
  • Y-x=15 y-x=5 using elimination
    6·1 answer
  • 100 POINTS!<br> SCAMMERS WILL NOT BE TOLERATED
    11·2 answers
  • To find the slope of the trend line below Reilly chose the points (1,80) and (2,30). explain whether the points she chose will h
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!