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 area in the console.
The values 10 and 200 are just arbitrary. The circle with radius < 10 would just look like a small dot on the window. The cricle with greater radius would spill out of the graphic window.
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
Try to extend flowchart and sanitze the user input to accept only positive radius values.