Help Flowcharting a Switch and case statement

Ok, I think I know how to flowchart this but an example would help out alot.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 switch (membershipType)
	{ case 'S' :
	membershipType = toupper(membershipType);
	if (membershipType == 'S'&& totalMthly < 75)
	{
		rewardPts = .005 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
	}
	else if (totalMthly >= 75 && totalMthly <= 149.99)
	{
		rewardPts = .075 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
		}
	else if (totalMthly >= 150)
	{
		rewardPts = .1 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
	}
	break;
	case 'P' :
	if (totalMthly < 150)
	{
		rewardPts = .06 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
	}
	else if (totalMthly >= 150)
	{
		rewardPts = .13 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
	}
	break;
	case 'Px' :
	if (totalMthly < 200)
	{
		rewardPts = .15 * totalMthly;
		cout << "Reward Points: " << rewardPts << endl;
	}
	}

	system("pause");
	return 0;


There really isn't much of a point in drawing a flowchart, but you can illustrate if and switch statements by making branches and labeling them with the conditions or values they correspond to. Actually, I don't think you really need a distinction between the two in a flowchart.

Oh, and unless your prof gave you hard instructions on how to draw flowcharts, don't worry too much about formalities. Their purpose is to illustrate, so as long as the idea is visible it's fine.
Topic archived. No new replies allowed.