Area of Circle Raptor Flowchart
Introduction
In this flowchart, we will calculate the area of a circle and display the graphics window if the radius is between 10 and 200 cm. If the radius of the circle is out of this range we just print the value in the console.
The values 10 and 200 are just arbitrary. The circle with a radius < 10 would just look like a small dot on the window. The circle with a greater radius would spill out of the graphic window.
IPO chart
Consider modeling an IPO chart for the flowchart before the flowchart design. Think about the input to the flowchart, processing statements, and the output of the flowchart. IPO chart is a handy tool to visualize in a tabular format.
Input | Process | Output |
Input to the flowchart. | Computations that are done in the flowchart. | Output displayed by the flowchart |
Math Formula
Area of Circle Flowchart
The following flowchart computes the area of the circle and displays the circle with the given radius.
To avoid small and big circles on the graphics window, the flowchart checks for the radius range (10, 200).
Output
Let’s run the flowchart with sample test cases to verify that it’s working as intended. If you find that the flowchart is not working as intended in the testing, we may need to verify and debug the flowchart.
Debugging a flowchart: https://www.testingdocs.com/debugging-a-raptor-flowchart/
Pseudocode
START Dim areaString Dim area Dim radius clear_console radius = 0 area = 0 PROMPT "Enter the radius of the circle(in cm):=" INPUT radius area = pi * radius * radius areaString = "Area of the circle is " + area If radius > 10 And radius < 200 Then open_graph_window(500,500) draw_circle(250,250,radius,light_gray,true) display_text(20,20,areaString,black) Else MsgBox areaString End If END
Input validation
Try to extend the flowchart and validate the user input to accept only positive radius values.
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/