TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • TestNG
  • Tools
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Do While Loop in Flowgorithm Flowchart

Flowgorithm

Overview

In the Do While Loop structure, the loop statements are executed before the loop condition check. Like the While loop the Do While loop is an indefinite loop. We can use this loop when we don’t know how many times the loop will run.

However, unlike the While statement, the Do While loop checks the condition after executing the loop statements. So the loop statements are executed at least once.

Do While Loop

To add the Do While loop to the flowchart, right click on the control flow line and choose the Do loop statement.

 

Do While Loop Flowgorithm

 

Example

Let’s look into an example where the Do While loop is used. It’s a menu based program to perform two actions based on the user input.

The Do While loop is natural for menu based loops. The loop displays the menu statements and prompts the user to take different actions. Based on the user input the Do while loop executes the loop or terminates.

 

DoWhileLoopExample_Flowgorithm

 

Pseudocode

Function Main
... Demo Flowchart for Do While Loop 
... - www.TestingDocs.com
Declare Integer userChoice

Loop
 Output "Program Menu:"
 Output "1. Task1"
 Output "2. Task 2"
 Output "3. Quit"
 Output "Please choose menu option:"
 Input userChoice
 If userChoice == 1
 Output "Performing Task 1 ..........."
 End
 If userChoice == 2
 Output "Performing Task 2 ..........."
 End
Do userChoice != 3
End

Sample Output

Run the flowchart to see how the loop runs and displays the menu for the user until the user chooses to quit.

Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
1
Performing Task 1 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
2
Performing Task 2 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
1
Performing Task 1 ...........
Program Menu:
1. Task1
2. Task 2
3. Quit
Please choose menu option:
3

—

Flowgorithm Tutorials Link:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website:

http://flowgorithm.org/

Related Posts

Flowchart Style Flowgorithm

Flowgorithm /

Flowgorithm Tool Features

Control Panel

Flowgorithm /

Uninstall Flowgorithm on Windows

Source Code Generator Flowgorithm

Flowgorithm /

Source Code Generator Tool in Flowgorithm

Populate Array Flowgorithm Flowchart

Flowgorithm /

Populate Array with User Input in Flowchart

Flowgorithm /

Recursion in Flowgorithm Flowchart

‹ While Loop in Flowgorithm Flowchart› User Defined Functions in Flowgorithm

Recent Posts

  • Antivirus Products for Windows 11 PC
  • Install CodeBlocks IDE on Windows 11
  • Location Privacy Settings on Windows
  • Windows 11 Virus & Threat Protection
  • Download & Install Python on Windows 11
  • Cumulative Update for Windows 11 Version
  • Test execution speed in Selenium IDE
  • Check Windows 11 Free Upgrade
  • Download IntelliJ IDE on Windows 11
  • New MySQL Connection in Workbench

Back to Top

Automation Tutorials

  • JBehave Tutorial
  • Selenium Tutorial
  • TestNG Tutorial
  • JUnit Tutorial

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version