TestingDocs.com
Testing Questions
  • JBehave
  • Selenium
  • Maven
  • TestLink
  • Git
  • RAPTOR
  • Contact

How to create a Flow Chart for sum of squares for N integers?

Tweet
Pin it

Document Contents

  • Introduction
  • Mathematical Notation
  • Steps to build
  • Loop Structure
  • Flowchart
  • Raptor Flow chart Sum of squares
  • Screenshot
  • Sample Output of the Flowchart
  • More Flowchart Examples
  • Raptor Tutorial

Introduction

The raptor Flow chart enables you to create executable flowcharts. Mathematical notation for the sum of squares is shown:

Mathematical Notation

Mathematical notation for the sum of squares up to n numbers is:

 

\fn_phv \huge Sum of Squares = \sum_{i=1}^{n} i^{2}

 

or in simple notation

 

\fn_phv \huge Sum = 1^{2} + 2^{2} + 3^{2} + . . . + n^{2}

 

 

Sum of Squares Math Formula

Test Case Scenario Detailed Steps Test Data Expected Result Actual Result
Find the sum of squares of N integers.
  • Launch Raptor.
  • Model the flowchart.
  • Execute the flowchart.
  • Enter N.
10 385 To be filled after executing the flowchart. The actual result should match the expected result.

Steps to build

Raptor flow chart steps for the program is shown below:

Start the Raptor flowchart tool.
You would be provided with a flowchart with Start and End symbols.

Save the flowchart with a name.
Add Assignment symbols for Assignment( left-clicking once on the symbol and then adding it between Start and End.)
i <- 1
sum <- 0
series <- ” ”

Add Input symbol to the flowchart. Double click to add the prompt “Enter number” and use the variable name N.

Loop Structure

Add a loop structure to the flow chart.

https://www.testingdocs.com/questions/how-to-add-repetition-structure-to-the-raptor-flowchart/

Edit its expression to

i > N

In the loop structure for NO decision, do the following things:

Add Assignment symbols to the flowchart to the flowchart for sum, series and i
sum <- sum + ( i* i )
series <- series + ” ” + ( i*i )
i <- i + 1
Add an Output symbol to the flowchart to output series

series <- series + ” ” + ( i*i ) statement is just to print the series to the output console window.

Flowchart

Flow chart Sum of squares

Raptor Flow chart Sum of squares

In the loop structure for YES decision,
Add an Output symbol to the flowchart to output the sum

 

 

sum of sqaures

Once you are done with a flow chart, You can execute the Raptor flow chart by clicking on Execute to completion button.  You can verify the inputs and outputs in the run. ( Explore Run menu options for more details).  While designing the flow chart you can even test and debug using the “Step to Next shape” button.

Screenshot

Raptor Flowchart Run

Sample Output of the Flowchart

Series= 1
Series= 1 4
Series= 1 4 9
Series= 1 4 9 16
Series= 1 4 9 16 25
Series= 1 4 9 16 25 36
Series= 1 4 9 16 25 36 49
Series= 1 4 9 16 25 36 49 64
Series= 1 4 9 16 25 36 49 64 81
Series= 1 4 9 16 25 36 49 64 81 100

Sum of squares:385

More Flowchart Examples

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

Raptor Tutorial

Raptor Tutorials on this website can be found at:

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

RAPTOR official website: https://raptor.martincarlisle.com/

Related Posts

Bull

RAPTOR Flowcharts /

How to draw Bull’s Eye Raptor Graphics Flowchart

Weekly Gross Pay Raptor Flowchart

RAPTOR Flowcharts /

Weekly Gross Pay Raptor Flowchart

Reptition Structure

RAPTOR Flowcharts /

How to add repetition structure to the Raptor Flowchart

Selection Symbol

RAPTOR Flowcharts /

How to use selection symbol in Raptor flowchart

Calculator Raptor Flowchart

RAPTOR Flowcharts /

Calculator Raptor Flowchart

Tag Cloud

Eclipse Git Java Programs Mathematics

Random Questions

  • How to connect to pluggable database (PDB) using SQL*Plus?
    Overview In this tutorial, we will learn the steps

    Read more

  • How to manually Update new Edge Browser on Windows 10
    Introduction In this tutorial, we will go through the

    Read more

  • How to setup JDK 15 environment in IDEs
    Overview In this tutorial, we will see the steps how

    Read more

Back to Top

TestingDocs.com

  • Privacy Policy
  • Cookie Policy
  • JBehave
  • Selenium
  • Maven
  • TestLink
  • Git
  • RAPTOR
  • Contact
www.TestingDocs.com | All Rights Reserved