Purchase Solution

Java Programming : Switch Statements and Switch blocks

Not what you're looking for?

Ask Custom Question

If x is currently equal to 5, what will the value of x be after the switch statement executes? Answer is 11. Please explain.The switch statement is

switch (x)
{
case 3:
x+=1
case 4:
x+=2
Case 5:
x+=3
case 6:
x++;
case 7:
x+=2
case8:
x--
case 9:
x++

Purchase this Solution

Solution Summary

Switch statements and switch blocks and Java programming are investigated.

Solution Preview

Let's go through the switch block.
Since x=5, then it goes to Case 5 directly and get x+=3. This means ...

Purchase this Solution


Free BrainMass Quizzes
Probability Quiz

Some questions on probability

Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

Know Your Linear Equations

Each question is a choice-summary multiple choice question that will present you with a linear equation and then make 4 statements about that equation. You must determine which of the 4 statements are true (if any) in regards to the equation.

Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.