TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Flowchart to convert distance in Kilometers to Miles

Overview

In this tutorial, we will learn to design a Flowgorithm flowchart to convert distance in kilometers to miles.

Problem Statement

Draw a flowchart that asks the user to enter the distance in Kilometers. The flowchart computes the distance in Miles using the following formula:

Miles = 0.62137 × Kilometers

Flowchart Output

The program should display the distance in Kilometers and Miles. The output requirement is that the flowchart should only display three digits after the decimal point for both kilometers and miles output.

The desired flowchart output is as follows:

Distance:
Kilometers = 100

Miles = 62.137

Flowchart

Steps to design the flowchart are:

  • Launch Flowgorithm Flowchart tool
  • Save the flowchart with a name in the .fprg file
  • Add a comment with a Flowchart description
  • Declare two variables: Kilometers, Miles
  • Prompt user to enter the distance in kilometers
  • Store the user input into the Kilometers variable
  • Compute and process the user input
  • Display the desired output to the computer screen

Kilometers to Miles Flowchart Flowgorithm

Sample Output

Save the flowchart and run it with sample input.

Verify the flowchart output.

Convert Distance Kilometers to Miles

Test Case 1

Enter distance in Kilometers:=
100
Distance:
Kilometers = 100
Miles = 62.137

Test Case 2

Let’s consider the following input to the flowchart. This makes the test case is a fail.

Enter distance in Kilometers:=
10.568896667
Distance:
Kilometers = 10.568896667
Miles = 6.56719532197379

The output displays more than three decimal places in the output. We need to fix this bug in the flowchart. We can use the ToFixed() inbuilt function to display a certain number of digits after the decimal point.

 

Desired Flowchart Output Flowgorithm

 

That’s it. We have successfully designed a flowchart to convert distance from kilometers to miles.

—

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

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

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Related Posts

Print Triangle Pattern Flowchart

Flowgorithm /

Print Triangle Pattern Flowchart

Flowgorithm Breakpoint Symbol

Flowgorithm /

Flowgorithm Conditional Breakpoint Statement

File Read Declare Variables

Flowgorithm /

Flowgorithm Read Numbers from File Example

File Search Input File Flowgorithm

Flowgorithm /

Search Text File Flowchart Example

Flowgorithm Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Symbols

‹ Fibonacci Series Flowchart using Recursion› Flowgorithm Nested If Statements

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com