0 like 0 dislike
40 views
in Computer Science by (1.0m points)
Draw the flow chart of while loop.

1 Answer

0 like 0 dislike
by (1.0m points)
If an action or decision node has an exit transition with a guard as well as a second exit transition, and there is also a transition that brings the flow back to the original decision point, IBM® Rational Rhapsody recognizes that these elements represent a while loop, and generates the appropriate code.

Generation of for loops in flowchart code

If an action or decision node has an exit transition with a guard as well as a second exit transition, and there is also a transition that brings the flow back to the original decision point, you can have Rational Rhapsody generate a for loop rather than a while loop by carrying out the following steps.

Open the Features window for the action or decision that has the guard for exiting the loop, and apply the stereotype FlowChartForLoop to the element.

After setting the stereotype for the element, enter the relevant loop initialization code in the Loop initialization field on the General tab of the Features window.

Enter the relevant loop increment code in the Loop step field on the General tab of the Features window.

For example, the following flowchart segment will result in a for loop, as can be seen in the generated code that follows it. In this example, the code used for Loop initialization was monthCounter = 1, and the code used for Loop step was monthCounter++

Related questions

0 like 0 dislike
1 answer 57 views
asked Feb 11, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
0 answers 52 views
0 like 0 dislike
1 answer 61 views
asked Nov 19, 2018 in Physics by danish (1.0m points)
0 like 0 dislike
1 answer 155 views
asked Feb 9, 2019 in Biology by danish (1.0m points)
0 like 0 dislike
1 answer 81 views
asked Apr 5, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 71 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 387 views
asked Apr 5, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 72 views
0 like 0 dislike
1 answer 66 views
asked Apr 4, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 60 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

6.3k users

Free Hit Counters
...