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

Raptor Flowchart

Average of Three Numbers Flowchart

Overview

In this post, we will model a flowchart to find the average of three numbers. In general, the average of n numbers is computed as:

 

\LARGE average = \frac{sum}{n}

 

\huge Average = \frac{\sum_{i=1}^{n} x_{i}}{n}

sum = Sum of n numbers

Here, to calculate the average of three numbers  n = 3

Example

Let’s compute the average of the three numbers by hand. Let the three numbers be n1, n2, and n3.

For example, let’s assume the numbers are as follows:

n1= 31,

n2 = 43

n3 = 97.

In the first step, we need to compute the sum of the three numbers.

sum   =  31 + 43 + 97

= 171

In the second step, we need to compute the average of the three numbers.

Average = 171/ 3

= 57

IPO chart

IPO chart for the average of three numbers flowchart

Input Process Output
Three numbers n1,n2,n3 AverageOfThree = (n1 + n2 + n3)/3

 

Output displayed by the flowchart

AverageOfThree

Pseudocode

Average of 3 numbers Flowchart PseudocodeRAPTOR Flowchart

We will prompt the user to enter three numbers. In the flow chart, we will compute the average of the user-entered numbers. In the end, will display the result i.e average of the three numbers.

Let the numbers are: n1, n2, and n3

We will store the average in the variable: averageOfThree

Prompt the user with the numbers.

 

Average Of Three Numbers

 

  • Drag and drop the three Input symbols to the workspace.
  • Compute the average :
  • average = (n1 + n2 + n3 ) /3
  • Drag and Drop the Assignment symbol. Perform the computation.
  • Display the average.
  • Drag and drop the output symbol and print the result.
  • Execute the flow chart.

Flowchart Output

Let’s execute a sample test case to test the output of the flowchart. The flowchart should be tested and the output should be validated for proper working.

 

Test Case Scenario Detailed Steps Test Data Expected Result Actual Result
Add three numbers. Launch Raptor.

Execute the flowchart.

Enter three numbers as input.

31

43

97

57

 

Run the flowchart and enter the three numbers.

 

We can see in the output in the MasterConsole window that the output is displayed.

Using Array

To compute the average for more numbers i.e n> 3 the disadvantage of this approach is to maintain n

variables to hold the numbers. i.e n1,n2,n3 …. n

We can use an array to hold the numbers. Arrays are used to hold the variables of the same data type.

To compute the average of more variables using an array:

Average of array elements

RAPTOR Tutorials

RAPTOR tutorials on this website can be found here:

https://www.testingdocs.com/raptor-a-flowchart-tool/

Flowchart examples:

https://www.testingdocs.com/raptor-flowchart-examples/

RAPTOR official website:

https://raptor.martincarlisle.com/

Related Posts

Install RAPTOR Avalonia CentOS

Raptor Flowchart /

Install RAPTOR Avalonia on CentOS

RAPTOR Avalonia Edition Windows

Raptor Flowchart /

Download RAPTOR Avalonia Edition on Windows

RAPTOR Editions

Raptor Flowchart /

RAPTOR Editions

RAPTOR flowcart to write to a file output

Raptor Flowchart /

Write to a file with RAPTOR flowchart

Sum of Squares Array Elements Modular Approach

Raptor Flowchart /

Sum of Squares of Given Array Elements

‹ Create an Interface in Raptor Flowchart› Adding Fields to a Class using Raptor

Recent Posts

  • How to secure your SQL Database: Tips and Tricks
  • Shaping the Future of Development: Exploring Key Trends in Software Engineering
  • Improving Java Performance with Multithreading
  • Difference between PHP and JavaScript?
  • Bing Conversation Styles
  • ChatGPT Introduction
  • Open Source AI Frameworks
  • Artificial Intelligence Tools
  • Top AI Music Applications
  • Top AI Website Design Tools

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com