Section 3.13 Check Point Questions5 questions 

3.13.1
What data types are required for a switch variable? If the keyword break is not used after a case is processed, what is the next statement to be executed? Can you convert a switch statement to an equivalent if statement, or vice versa? What are the advantages of using a switch statement?
3.13.2
What is y after the following switch statement is executed? Rewrite the code using an if-else statement.
x = 3; y = 3;
switch (x + 3) 
{  
  case 6:  y = 1;
  default: y += 1;
}
3.13.3
What is x after the following if-else statement is executed? Use a switch statement to rewrite it and draw the flowchart for the new switch statement.
int x = 1, a = 3;
if (a == 1)
  x += 5;
else if (a == 2)
  x += 10;
else if (a == 3)
  x += 16;
else if (a == 4)
  x += 34;
3.13.4
Write a switch statement that displays Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, if day is 0, 1, 2, 3, 4, 5, 6, accordingly.
3.13.5
Rewrite the switch statement in Listing 3.8 using an if-else statement.