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
Can someone please help me with the 2 questions below. (they go together)
il63 [147K]

Answer:

r=√(A/π)

r=2.8

Step-by-step explanation:

We want to get (r) alone on one side

A=πr^2

divide each side by π

A/π=r^2

square root each side

√(A/π)=r

r=√(A/π) is the answer to your first question.

now we are given A

r=√((25)/3.14)

put the left side into a calculator

r=2.8216632

round to nearest tenth of a centimeter

r=2.8

6 0
3 years ago
1. Today Amy’s bank account contains $116.85. Yesterday she made a deposit of $32.50. What was the bank account balance before A
V125BC [204]
Amy had $84.35 before the deposit.
$116.85 - $32.50 = $84.35
8 0
4 years ago
Read 2 more answers
The number of bacteria in a culture grew exponentially. When the experiment began, there were 100,000. Ten minutes later, that n
ElenaW [278]

Answer:

y = 100,000(1.08)^x

Step-by-step explanation:

7 0
3 years ago
How do you write 6n + 8n + 4as a product of 2 factors?
Alla [95]
14n+ 4 = 2( 7n + 2 ) ; the factors are 2 and ( 7n + 2 ) ;
8 0
3 years ago
What is the total probability of rolling a single die twice, and having it land on 3 the
Shtirlitz [24]

Answer:

0,5*0,5=0,25

Step-by-step explanation:

assuming a die of 6 faces

25

0,5 for < 4; 0,5 for < 3

5 0
2 years ago
Other questions:
  • What is the slope of y=7x+4
    14·1 answer
  • What is the value of x?
    8·2 answers
  • If two triangles have three congruent, corresponding angles, what addiitional infortmation is needed to prove that the triangles
    12·1 answer
  • HELP ME PLEASEEEEEESS
    9·1 answer
  • What is the common factor for the expression: 6x + 3xy +12xz?
    13·2 answers
  • Write the ratio in its simplest form using the colon. 24 blue cars out of 48 cars.
    15·1 answer
  • the local frozen yogurt store has two different containers for customers to use micheal chooses the container below the second c
    7·1 answer
  • 10 x 1/2+(-6)(-3) simplified in steps
    12·1 answer
  • Share £360 into the ratio 3:2:1
    7·1 answer
  • -3(x-5)-2x=-10 solve for x
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!