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
Match each slope and y-intercept with the appropriate linear equation.<br>​
Kamila [148]

Answer:

see below

Step-by-step explanation:

(1,4)

(2,1)

(3,2)

(4,3)

i listed them in the order shown, like if i wrote 4 then it's 4th on the list lol

7 0
3 years ago
Read 2 more answers
You withdraw $29.79 from your bank account. Now your balance is $20.51. Write and solve an equation to find the amount of money i
avanturin [10]
X-29.79=20.51 or 29.79+20.51=x

x=50.30
3 0
3 years ago
Read 2 more answers
The owner of a clothing store buys T-shirts for c dollars each and sells
leva [86]

Answer:

Idek c

Step-by-step explanation:

6 0
3 years ago
Choose the more precise measurement from the pair 54.1 cm and 54.16 cm.
Tamiku [17]

Answer:

a

Step-by-step explanation:

Precision means that a measurement using a particular tool or implement produces similar results every single time it is used. For example, if you step on a scale five times in a row, a precise scale would give you the same weight each time. In math and science, calculating precision is essential to determine if your tools and measurements work well enough to get good data. You can report precision of any data set using the range of values, the average deviation, or the standard deviation.

5 0
3 years ago
a recipe calls for 1/2 a cup of water for every 1/3 cup of milk. How many cups of water are needed per cup of milk
Alex787 [66]
You will need 1 1/2 cups of water per cup of milk.
7 0
3 years ago
Read 2 more answers
Other questions:
  • How do this problem 18
    8·1 answer
  • In a chemical compound there are three parts zinc for every 16 parts copper by mass. A piece of the compound contains 320 g of c
    15·1 answer
  • PLS HELP ME.
    15·1 answer
  • PLZ HELP, SUPER EASY IF YOU ARE SMARTER THAN ME! lol Will mark brainliest for first CORRECT answer!!!!! BUT ONLY IF ANSWER IS IN
    10·1 answer
  • Please help me with this math question ​
    13·1 answer
  • Find the area of a circle that has a radius of 60.4 m. Put your answer as yards squared rounded to 1 decimal.
    11·1 answer
  • How do you express 45mins as percentange of 1hr30mins
    5·2 answers
  • What constant acceleration is required to increase the speed of a car from 23 mi/h to 51 mi/h in 5 seconds? (Round your answer t
    13·1 answer
  • For the function g(x)=3-8(1/4)^2-x
    8·1 answer
  • Cassandra already has $224 in a bank account.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!