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
UNO [17]
3 years ago
11

What are the values of i and j after the following code snippet is run? int i = 10; int j = 20; int count = 0; while (count <

5) { i = i + i; i = i + 1; j = j - 1; j = j - j; count++; } System.out.println("i = " + i + ", j = " + j);
Mathematics
1 answer:
AlexFokin [52]3 years ago
6 0

Answer:

i = 351, j = 0

Step-by-step explanation:

The while loop runs 5 times as indicated by the variable, count.

The variable, i, has an initial value of 10. The first line of the loop code doubles the value of i while the second increments it by 1. This is done 5 times. We have

Iteration 1: i = 10 + 10 + 1 = 21

Iteration 1: i = 21 + 21 + 1 = 43

Iteration 1: i = 43 + 43 + 1 = 87

Iteration 1: i = 87 + 87 + 1 = 175

Iteration 1: i = 175 + 175 + 1 = 351

The third line of the loop code decrements j by 1. However, the fourth line sets j = 0 by subtracting it from itself. Hence, j is always 0 at the end of the loop, no matter its initial value or the number of iterations.

Thus, at the end of the code snippet, i = 351 and j = 0.

You might be interested in
If a triangular pyramid has a base area of 10ft and a height of 6ft, what is the volume?
arlik [135]

Answer: 20 ft³

Step-by-step explanation:

volume of triangular pyramid = \frac{1}{3} bh

  • b = base area = 10 ft
  • h = height = 6 ft

Therefore, the volume is:

\frac{1}{3} *10*6=\frac{1}{3}*60=\frac{60}{3}=20

4 0
3 years ago
Write a polynomial that represents the area of the square.
Tema [17]

Answer:

The answer to your question is Area = 49n² - 70n + 25    

Step-by-step explanation:

Data

Length of the side = 7n - 5

Formula

Area of a square = side x side

Process

1.- Substitute values

Area = (7n - 5)(7n - 5)

2.- Expand

Area = 49n² - 35n - 35n + 25

3.- Simplify

Area = 49n² - 70n + 25    

4.- The polynomial is 49n² - 70n + 25  

6 0
3 years ago
Read 2 more answers
Write an equation that represents the line.<br> Use exact numbers.
jolli1 [7]

Answer:

1x-2y

Step-by-step explanation:

You have to go down 2 on the y-axis and over to the right 1 on the x axis

3 0
3 years ago
Help please quickly thank you so much
STALIN [3.7K]

Answer:

120 deg

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Anybody...Help!!!!!!!!!!!
Sloan [31]
Simple...

when they ask for the rate of change they ask for slope -->>

Using \frac{ y_{1} - y_{2} }{ x_{1} - x_{2} } to find the rate of change for (-3,0) and (-2,-5)

\frac{0--5}{-3--2}

\frac{0+5}{-3+2}

\frac{5}{-1}

m=-5 

Thus, your answer.


4 0
3 years ago
Other questions:
  • Draymond green averaged 5.1 field goal shot attempts per game. Stephen curry averaged 10.2 field goal shot attempts per game. Ho
    5·1 answer
  • BRAINLIEST AND POINTS NEED HELPPP
    11·1 answer
  • For an analysis of variance, if the between-group estimate of the population variance is 30, and the within-group estimate is 25
    7·1 answer
  • Which two temperatures have a sum of 0 degrees Celsius?
    12·1 answer
  • HI IM having A REALLY REALLY hard time with this problem and i desperately need help can someone please help me!
    12·2 answers
  • Jason earned scores of 90 points, 82 points, 95 points, and 86 points on four tests. What is the lowest score he can get on the
    6·2 answers
  • The odds in favor of an event are 2:9 or 2/9. What are the odds against the event?
    12·1 answer
  • A set of weights includes an 8 lb. barbell and 6 pairs of weight plates. Each pair of plates weighs 15 lb. If x pairs of plates
    11·1 answer
  • Does anyone on here watch attack on titan??
    6·2 answers
  • In a certain year, 20% o RSM AMC 10 participants were invited to compete in American Invitational Mathematics Examination. How m
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!