Flowchart else if

て烟熏妆下的殇ゞ 提交于 2019-11-29 12:37:56

问题


I'm making a flowchart a for an algorithm, and came into some problem for an else if statement.

For an if-statement such as this one

if (something) {}
else if (something) {}
else {}

How would the else if statement look like in a flowchart diagram?


回答1:


http://code2flow.com allows you to create such flowcharts from code.

You may click to edit this.




回答2:


Here is the DRAKON version of this:

if (case1) {outcome1}
else if (case2) {outcome2}
else {outcome3}

Alternatively, it could look like this:

See here: http://en.wikipedia.org/wiki/DRAKON




回答3:


You could diagram this as two separate if statements.

I don't know if this is the "standard" method, but that's what I do.




回答4:


For starters, let's recast the statement.

if (case1) {outcome1}
else if (case2) {outcome2}
else {outcome3}

Does it not flow thus?

case1? yes --> outcome1

no --> case2? yes --> outcome2

no --> outcome3



来源:https://stackoverflow.com/questions/7718619/flowchart-else-if

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!