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
Scilla [17]
3 years ago
12

Consider the following switch statement where x is an int. If x is currently equal to 5, what will the value of x be after the s

witch statement executes? switch (x) { case 3 : x += 1; case 4 : x += 2; case 5 : x += 3; case 6 : x++; case 7 : x += 2; case 8 : x--; case 9 : x++
Mathematics
1 answer:
Sphinxa [80]3 years ago
3 0

Answer:

x=11

Step-by-step explanation:

The switch case works like an if or if-else, where each of the cases are conditionals. Here we have 7 cases and we know that our variable begins with x=5.

First, it enters to case 5 because of x=5, so x+=3, this means we add 3 to the actual value of the variable ⇒ x=8.  

At this point, if there's not break the program continues to the next case, executing the statements until a break or the end on the switch is reached.  

In this order, the x = 8 and next we add 1 (case 6) ⇒ x=9. We add 2 (case 7) x+=2 ⇒ x=10. Then we rest 1 (case 8) ⇒ x=9 and then we add 1 again as in case 9 ⇒ x=11.

You might be interested in
If y = f(x) = A(0.5)* + B is increasing on the interval (-0, o), which statement must be true?
Elena L [17]

Answer:

B) A < 0

Step-by-step explanation:

I had the same question, and got it right.

7 0
3 years ago
Read 2 more answers
Make a place value drawing of a number that has double the number of tens as ones and 3 times the number of thousands then hundr
Allisa [31]
For the answer to the question above asking to m<span>ake a place value drawing of a number that has doubled the number of tens as ones and 3 times the number of thousands then hundreds</span>

I think the answer to this question is 6,622
7 0
2 years ago
If any of you want to be dora can you help me with these question please.
Sergeeva-Olga [200]
The answer is 3 because the length of the box is 10, the width is 5, and the height is 3.
7 0
3 years ago
Read 2 more answers
Find the length of a rectangle with a diagonal of 10 and a height of 8.
Dmitry_Shevchenko [17]

Answer:

The length of the rectangle is 6.

Step-by-step explanation:

Given: The diagonal of a rectangle is 10 and the height is 8.

Please understand, that a diagonal, divides the rectangle into two tringles.

To find the length of the rectangle, you can use Pythagoras on one of the right sided triangles, because the length of the triangle, is also the length of the rectangle!

<em>EXTRA:</em>

<em>If</em><em> you know the special 3 4 5 triangle, a so called Pythagorean Triple, then you can "see" the simularity between the numbers.</em>

<em>Instead of 5, a diagonal of 10 is given (factor of 2 bigger).</em>

<em>Instead of 4, the height of 8 is given (factor of 2 bigger</em><em>)</em><em>.</em><em> </em><em>By scaling the Pythagorean Triple 3 4 5 by a factor of 2, you get the numbers 6 8 10. Could it be, that the number we need to find, is six?</em>

Try to verify, by calculating the missing number (which is the length of the rectangle we are looking for).

a² + b² = c²

a = length (and is unknown)

b = height = 8

c = hypothenusa/diagonal = 10

Substitute the numbers given:

a² + 8² = 10²

Subtract 8² left and right of the = sign.

a² +8² -8² = 10² - 8²

a² + 0 = 100 - 64

a² = 36

a = + - √36

a = + - 6

<em>EXTRA</em><em>:</em>

<em>You</em><em> can ignore the -√36 = -6 part of the solution, because a length of -6 has no meaning here.</em>

a = 6

So, the length of the triangle is 6 and thus, the length of the rectangle is also 6.

8 0
3 years ago
A rectangle has a perimeter of 150 feet and a base of 45 feet. What is the height?
frez [133]

Answer:

30

Step-by-step explanation:

45+45 = 90

150-90 = 60

60/2 = 30

I think...

8 0
3 years ago
Other questions:
  • 9. The points (4, –6) and (9, -6) represent the location of two towns on a
    12·1 answer
  • A mixture of chlorine and water contains a total of 60 gallons. There are 30 gallons of pure Chlorine in the mixture. (I) what p
    7·1 answer
  • Victor will choose 6 colors to use for an art project. If there are 12 colors to choose from, how many different color combinati
    10·1 answer
  • Whar steps do you do for finding what the percent of 80 is 10?
    7·1 answer
  • BEDMASS or PADMASS solve this pls
    7·1 answer
  • PLEASE HELP!!!!
    9·1 answer
  • SOMEONE HELP ME PLEASE AND STOP PUTTING THOES LINKS PLEASE<br> THIS IS A TEst
    15·1 answer
  • Calculate the product below and give your answer in scientific notation.
    14·1 answer
  • A flagpole casts a shadow that is 50 feet long. At the same time, a woman standing nearby who is 6 feet tall casts a shadow that
    9·1 answer
  • What number is multiple by itself the result is 3 6/25 find the number
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!