answersLogoWhite

0


Best Answer

Switch case can be flowcharted using a diamond for each case, with a right branch for true and a down branch for false. The false branch simply connects to the next case. The true branch connects to the statement that should be executed for that case. Where multiple cases result in the same statement, the true branches should converge upon that statement. The execution path from the statement(s) should converge with the final false branch of the switch case.

In this case, your switch case might be as as follows:

print %letter%

switch lowercase (%letter%)

{

case 'a':

case 'e':

case 'i':

case 'o':

case 'u':

print line " is vowel"

break;

default:

print line " is not vowel"

}

Thus you will have a column of diamonds for each case with false branches linking downwards from one diamond to the next. The statement for case 'a', 'e', 'i', 'o' and 'u' is the same, so their true branches (extending to the right) will converge upon the 'print line " is vowel"' statement which must be placed to the right of the case diamonds. The default case's true branch leads to the 'print line " is not vowel"' statement. Both these statements will then converge with the false branch from the default case, marking the end of the switch case.

Note that, logically, there is no false branch from a default case, thus this link may be omitted. However, all links from all statements must still converge below the default case.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Rahul murugasamy

Lvl 2
3y ago

Hjj

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the flowchart C program to check wether a given character is vowel or not using switch case?
Write your answer...
Submit
Still have questions?
magnify glass
imp