CIT100 Programming Language Concepts Quiz 2 Your Name: 14. The following is part
ID: 3875000 • Letter: C
Question
CIT100 Programming Language Concepts Quiz 2 Your Name: 14. The following is part of a switch block. Cirele the correct code switch (userinput.ToUpper) Il userlnput is a declared string variable a. caseR b. case R: c. case (aletter=-"R"): d. case "R 15. The following is part of a switch block. Explain why there is no code for case"A" case "A": case "B": ibl Display Text = "How are you?" break; 16. In a switch block, certain cases use the key word "break" because the programmer wants this to happen Other cases use the key word "return" because the programmer wants this to happen: 17. How do you manually add a list of college names to a ComboBox to be displayed? (Explain which property you should go and what you should do then.)Explanation / Answer
14. The following is part of a switch block. Circle the correct code
switch(userInput,ToUpper())
{
a. case=="R":
b. case R:
c. case(aLetter=="R"):
d. case "R":
Answer: correct answer is d.
15. The following is part of switch block. Explain why there is no code for case "A"
.....
case "A":
case "B":
|b|Display.Text="How are you?";
break;
........
Ans: In such case where there is no statement under any case of a switch block, program flow will go to next case and will execute the staements of next case.
So in above program if in switch block identifier "A" selected, then statements of case "B" would be executed.
16. In switch case 'break' is used .after executing 'break' control of the program will get out of the switch case.
In switch case 'return' is used .after executing return it will return the values to the calling function.