duartealondra45
05.12.2020 •
Mathematics
The circle graph shows with the fraction of each type of weather during September
Solved
Show answers
More tips
- B Business and Finance What is the Difference Between Visa and Visa Gold?...
- A Animals and plants Why do cats go crazy over catnip?...
- W Work and Career Everything You Need to Know About MBA Programs...
- S Sport How to Do Push-ups Correctly?...
- S Style and Beauty How to Grow Hair Faster: Real Methods and Advice...
- F Family and Home How to Remove Fading from Clothes: Tips and Tricks...
- F Food and Cooking How to Make Polendwitsa at Home?...
- F Family and Home Parents or Environment: Who Has the Most Influence on a Child s Upbringing?...
- P Philosophy Unbelievable stories of encounters with otherworldly forces...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
Answers on questions: Mathematics
- M Mathematics 2. Janet baby-sat for 28 hours over two weeks. She earned $5.00 an hour. What was her gross pay?...
- M Mathematics I CAN HEELP WITH SPANISH STUFF PLEASE HELP MEEE...
- M Mathematics Irma has $500 to open a checking account. She wants an account with the lowest fees. She plans to use only her bank s ATM to deposit her paychecks and withdraw cash....
- M Mathematics If the ratio between the radil of the two spheres is 3:7, what is the ratio of their volumes? O A 97 O B. 9:49 O c. 21:49 OD 27343...
- M Mathematics In ³_/13, the 13 is called the:radical signradicandradicalindex...
- M Mathematics -2(bx-5)=16 The valuse of x in terms of b is ? The value of x whenb is 3 ?...
- M Mathematics Eating lunch at 12:17 PM and finished at 1:01 PM what is the elapsed time...
- M Mathematics The length of the rectangle is x + 12. The width of the rectangle is x + 3. Please determine the area of the rectangle....
- M Mathematics 100 POINTS AND BRAINIEST TO THE BEST CORRCET ANSWER. A scatter plot of data comparing the humber of years since Holbrook High School introduced a math club and the...
- M Mathematics What does x+5 8 equal...
Ответ:
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